/ Published in: Ruby
Expand |
Embed | Plain Text
# How to define and use a singleton class # - modifies the class's class # - instance methods in the singleton class are class methods externally class TheClass class << self def hello puts "hi" end end end # invoke a class method TheClass.hello # hi
You need to login to post a comment.
