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.



47105
47106
47107
47108
47109
47110
47111
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47105

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.



47103
47104
47105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47103

def country
  @country
end

#currencyObject (readonly)

Returns the value of attribute currency.



47103
47104
47105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47103

def currency
  @currency
end

#ipObject (readonly)

Returns the value of attribute ip.



47103
47104
47105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47103

def ip
  @ip
end

#languageObject (readonly)

Returns the value of attribute language.



47103
47104
47105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47103

def language
  @language
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



47117
47118
47119
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47117

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

#to_hashObject



47121
47122
47123
47124
47125
47126
47127
47128
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47121

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

#to_jsonObject



47113
47114
47115
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47113

def to_json
  JSON.dump(to_hash)
end