Skip to content

Instantly share code, notes, and snippets.

@anasbgoncalves
Last active August 22, 2017 09:08
Show Gist options
  • Save anasbgoncalves/15673358ea8d59f8024beb0e46f9f17e to your computer and use it in GitHub Desktop.
Save anasbgoncalves/15673358ea8d59f8024beb0e46f9f17e to your computer and use it in GitHub Desktop.
module Spoonacular
class Base
attr_accessor :errors
def initialize(args = {})
args.each do |name, value|
attr_name = name.to_s.underscore
send("#{attr_name}=", value) if respond_to?("#{attr_name}=")
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment