First, the class << foo syntax opens up foo's singleton class (eigenclass). This allows you to customize the behavior 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" ow, … Continue reading class << self in Ruby