Class: Io::Flow::V0::Models::OrderQuoteGeoPutForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Provides options that may be used to configure how a order_quote is rendered for a customer, such as currency and language.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderQuoteGeoPutForm

Returns a new instance of OrderQuoteGeoPutForm.



49205
49206
49207
49208
49209
49210
49211
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49205

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String))
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
  @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
  @language = (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))
end

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



49203
49204
49205
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49203

def country
  @country
end

#currencyObject (readonly)

Returns the value of attribute currency.



49203
49204
49205
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49203

def currency
  @currency
end

#ipObject (readonly)

Returns the value of attribute ip.



49203
49204
49205
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49203

def ip
  @ip
end

#languageObject (readonly)

Returns the value of attribute language.



49203
49204
49205
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49203

def language
  @language
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49217
49218
49219
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49217

def copy(incoming={})
  OrderQuoteGeoPutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



49221
49222
49223
49224
49225
49226
49227
49228
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49221

def to_hash
  {
    :country => country,
    :ip => ip,
    :currency => currency,
    :language => language
  }
end

#to_jsonObject



49213
49214
49215
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49213

def to_json
  JSON.dump(to_hash)
end