DEV Community

pooyaalamdari
pooyaalamdari

Posted on

super keyword

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

class C  
    include M
    def report 
        puts "'report' method in class C" #1
        puts "--- --- ---" #2
        super # it defined in class method #3
    end
end

c = C.new 
c.report
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
nlxdodge profile image
NLxDoDge • Edited

What language is this? Is this Ruby?