Skip to content

Instantly share code, notes, and snippets.

@frankie-loves-jesus
Created August 3, 2014 21:44
Show Gist options
  • Save frankie-loves-jesus/4cf8705b2adebaa9cf78 to your computer and use it in GitHub Desktop.
Save frankie-loves-jesus/4cf8705b2adebaa9cf78 to your computer and use it in GitHub Desktop.
class GetFromJson
include ActiveModel::Serializers::JSON
attr_accessor :first_name, :last_name, :country # :street_address, :postal_code, :phone, :email
def attributes=(hash)
hash.each do |key, value|
send("#{key}=", value)
end
end
def self.fetch
# ...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment