DEV Community

pooyaalamdari
pooyaalamdari

Posted on

calling method inside other method without dot (.)

class C  
    def x 
        puts "this is method <x>"
    end

    def y 
        puts "this is method <y>, about to call x without dot."
        x # C.x
    end
end

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

Top comments (0)