This post originated from an RSS feed registered with Ruby Buzz
by Patrick Farley.
Original Post: Real Class
Feed Title: Klank Boom Klang
Feed URL: http://klankboomklang.com/feed/
Feed Description: Ruby and otherwise by Patrick Farley
It interesting that Ruby, a language which allows you to so easily bypass encapsulation, encapsulates it’s own internals to the point of occasional prevarication. Heres an example…
pirate = Object.new
def pirate.speak
"Yarrrr"
end
pirate.class == Object.new.class
#=> true
In my last post I explained how the code above forces the interpreter to assign a newly created Singleton class to the [...]