Created
October 1, 2008 19:30
-
-
Save dcadenas/14166 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
#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