DEV Community

pooyaalamdari
pooyaalamdari

Posted on

module class method fast look

module M 
    def report
        puts "'report' method in module M"
    end
end

class C 
    include M # module M is mixed into class C
end

class D < C  # Class D is subclass class C

end

obj = D.new # obj is an instance of D

obj.report
Enter fullscreen mode Exit fullscreen mode

Top comments (0)