Skip to content

Instantly share code, notes, and snippets.

@szalansky
Created February 7, 2014 10:36
Show Gist options
  • Save szalansky/8860421 to your computer and use it in GitHub Desktop.
Save szalansky/8860421 to your computer and use it in GitHub Desktop.
Mass assigning with PORO
# 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