1. 1 Eric

    You say: We can see that the class method Foo#bar is not accessible within the instance — it would need to be explicitly called.

    In Ruby notation, Class#method is typically used to indicate an instance method and Class::method to indicate a class method.

    Also, classes and instances *do* actually meet in Ruby. A class is actually an instance of a class named Class.

    irb(main):001:0> class Foo
    irb(main):002:1> end
    => nil
    irb(main):003:0> f = Foo.new
    => #
    irb(main):004:0> f.class
    => Foo
    irb(main):005:0> Foo.class
    => Class

Leave a Reply