Skip to content

Instantly share code, notes, and snippets.

@mtrense
Last active August 29, 2015 14:25
Show Gist options
  • Save mtrense/9c10e89788def8211a3b to your computer and use it in GitHub Desktop.
Save mtrense/9c10e89788def8211a3b to your computer and use it in GitHub Desktop.
class Test
def initialize(attributes = {})
attributes.each do |name, value|
send "#{name}=".to_sym, value
end
end
attr :test1, :test2
end
Test.new test1: 123, test2: 'abc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment