Skip to content

Instantly share code, notes, and snippets.

@dcadenas
Created October 1, 2008 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcadenas/14166 to your computer and use it in GitHub Desktop.
Save dcadenas/14166 to your computer and use it in GitHub Desktop.
#Alternative to the use of aliasing
#This is one more alternative to what can be found here: http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html
module ClockRadioClassExtensions
module ClockRadioInstanceExtensions
def on!
super
@display_time = true
end
def display_time?
@display_time
end
end
def new
super.extend ClockRadioInstanceExtensions
end
end
ClockRadio.extend ClockRadioClassExtensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment