Created
January 19, 2011 07:59
-
-
Save wbailey/785845 to your computer and use it in GitHub Desktop.
Comment your meta-programming to reflect the actual code being executed
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
class NeverWriteCodeLikeThis | |
@@actions = ["create", "retrieve", "update"] | |
def initialize(val) | |
@@actions.each do |m| # ["create", "retrieve", "update"].each do |m| | |
instance_variable_set("@#{m}_process".to_sym, val) # instance_variable_set("@create_process".to_sym, val) | |
end # end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment