Skip to content

Instantly share code, notes, and snippets.

@polycarpou
Created October 10, 2013 14:45
Show Gist options
  • Save polycarpou/6919542 to your computer and use it in GitHub Desktop.
Save polycarpou/6919542 to your computer and use it in GitHub Desktop.
Day 14: TODO: Mass-assignment of properties at initialization
class Person
def initialize(attributes)
attributes.each do |key,value|
Person.send(:define_method, key){value}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment