Skip to content

Instantly share code, notes, and snippets.

@noeticpenguin
Created April 12, 2011 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noeticpenguin/915531 to your computer and use it in GitHub Desktop.
Save noeticpenguin/915531 to your computer and use it in GitHub Desktop.
attr_writer :dob, :anniversary
self.instance_variables.each do |x|
next unless self.methods.include? /#{x}=/
def x
return ---insert a call to your custom method here---
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment