Created
February 8, 2013 04:03
-
-
Save wlangstroth/4736517 to your computer and use it in GitHub Desktop.
Object under test
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
class Rule | |
def self.setters(*method_names) | |
method_names.each do |name| | |
send :define_method, name do |data| | |
instance_variable_set "@#{name}".to_sym, data. | |
end | |
end | |
end | |
setters :trigger | |
def initialize &block | |
@trigger = "blank trigger special_sauce" | |
instance_eval &block | |
"in a #{@trigger}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment