Created
October 10, 2013 14:17
-
-
Save irmiller22/6919108 to your computer and use it in GitHub Desktop.
Mass-Assign at Initialization
This file contains 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 Person | |
attr_accessor :name, :birthday, :hair_color, :eye_color, :height,:weight,:handed,:complexion,:t_shirt_size,:wrist_size,:glove_size, :pant_length,:pant_width | |
def initialize(attributes) | |
attributes.each do |key, value| | |
self.send("#{key}=", value) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment