Skip to content

Instantly share code, notes, and snippets.

@cheeyeo
Created November 2, 2010 11:38
Show Gist options
  • Save cheeyeo/659519 to your computer and use it in GitHub Desktop.
Save cheeyeo/659519 to your computer and use it in GitHub Desktop.
Using the singleton class of DifferentTextObject class without an Adapter object
diff_text_obj = DifferentTextObject.new(‘test’,’red’,10)
class << diff_text_obj
def text
@diff_text_obj.string
end
def colour
@diff_text_obj.color
end
def size_inches
@diff_text_obj.size_mm / 25.4
end
end
Renderer.render(diff_text_obj)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment