Created
March 5, 2013 00:37
-
-
Save havenwood/5087024 to your computer and use it in GitHub Desktop.
brittle example (irc)
This file contains hidden or 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
module Change | |
def Change.included klass | |
klass.class_eval do | |
def klass.change | |
def changed?; true end | |
end | |
end | |
end | |
end | |
class Without | |
include Change | |
def changed?; false end | |
end | |
class With | |
include Change | |
def changed?; false end | |
end | |
With.change | |
With.new.changed? | |
#=> true | |
Without.new.changed? | |
#=> false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment