DEV Community

pooyaalamdari
pooyaalamdari

Posted on

prepend پیش انداختن

prepend instead of include ?

module MeFirst
    def report
        puts "Hello from module!"
    end
end

class Person 
    prepend MeFirst

    def report
        puts "Hello from class"
    end
end

p = Person.new
p.report
Enter fullscreen mode Exit fullscreen mode

Top comments (0)