Class: Io::Flow::V0::Models::GeoForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::GeoForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Form used to update geographic preferences
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#experience ⇒ Object
readonly
Returns the value of attribute experience.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ GeoForm
constructor
A new instance of GeoForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ GeoForm
Returns a new instance of GeoForm.
33111 33112 33113 33114 33115 33116 33117 33118 33119 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33111 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:country, :currency, :language, :locale, :experience], 'GeoForm') @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String) @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String) @locale = HttpClient::Preconditions.assert_class('locale', opts.delete(:locale), String) @experience = HttpClient::Preconditions.assert_class('experience', opts.delete(:experience), String) end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
33109 33110 33111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33109 def country @country end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
33109 33110 33111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33109 def currency @currency end |
#experience ⇒ Object (readonly)
Returns the value of attribute experience.
33109 33110 33111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33109 def experience @experience end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
33109 33110 33111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33109 def language @language end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
33109 33110 33111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33109 def locale @locale end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33125 33126 33127 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33125 def copy(incoming={}) GeoForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
33129 33130 33131 33132 33133 33134 33135 33136 33137 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33129 def to_hash { :country => country, :currency => currency, :language => language, :locale => locale, :experience => experience } end |
#to_json ⇒ Object
33121 33122 33123 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33121 def to_json JSON.dump(to_hash) end |