# All is Object # ============= # # print - is singleton method for instance instance = Document.new def instance.print end class << instance def print; end end # print - is singleton method for Document # Document - is instance too of Class object def Document.pring end class Document class << self def print; end end end
Saturday, June 29, 2013
Ruby singleton
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment