Skip to content

Instantly share code, notes, and snippets.

@scudelletti
Created January 14, 2013 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scudelletti/4529250 to your computer and use it in GitHub Desktop.
Save scudelletti/4529250 to your computer and use it in GitHub Desktop.
Ruby Method Initialize
def initialize(opts)
opts.each do |opt,val|
instance_variable_set("@#{opt}", val.to_s) if respond_to? opt
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment