class
First, the class << foo syntax opens up foo‘s singleton class (eigenclass). This allows you to specialise the behaviour of methods called on that specific object. a=”foo” class << a def inspect ‘”bar”‘ end end a.inspect # => “bar” a=”foo” # new object, new singleton class a.inspect # => “foo” Now, to answer the question: … Read more