Created
February 7, 2014 10:36
-
-
Save szalansky/8860421 to your computer and use it in GitHub Desktop.
Mass assigning with PORO
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
# mass assign yay | |
args.each do |key, value| | |
m = "#{key}=" | |
self.send(m, value) if self.respond_to?( m ) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment