Created
December 16, 2013 18:38
-
-
Save yinquanteo/7991988 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'singleton' | |
class GlobalThingy | |
include Singleton | |
end | |
GlobalThingy.instance | |
GlobalThingy.instance.object_id | |
GlobalThingy.new | |
require 'forwardable' | |
class Secretary | |
def generate_report | |
"data" * 10 | |
end | |
end | |
class Boss | |
extend Forwardable | |
def_delegator :@secretary, :generate_report | |
def initialize(secretary) | |
@secretary = secretary | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment