Skip to content

Instantly share code, notes, and snippets.

@wbailey
Created January 19, 2011 07:59
Show Gist options
  • Save wbailey/785845 to your computer and use it in GitHub Desktop.
Save wbailey/785845 to your computer and use it in GitHub Desktop.
Comment your meta-programming to reflect the actual code being executed
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