Created
December 14, 2009 16:42
-
-
Save tal/256200 to your computer and use it in GitHub Desktop.
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
klass.replace_block(:matcher,[array,of,values]) do |scoped_klass,individual_value| | |
scoped_klass.my_method :foo, individual_value | |
end |
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
I want to implement the second one via instance_eval on klass but i'm not sure how to pass the block variable. |
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
klass.replace_block(:matcher,[array,of,values]) do |individual_value| | |
my_method :foo, individual_value | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment