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.



53078
53079
53080
53081
53082
53083
53084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53078

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.



53076
53077
53078
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53076

def country
  @country
end

#currencyObject (readonly)

Returns the value of attribute currency.



53076
53077
53078
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53076

def currency
  @currency
end

#ipObject (readonly)

Returns the value of attribute ip.



53076
53077
53078
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53076

def ip
  @ip
end

#languageObject (readonly)

Returns the value of attribute language.



53076
53077
53078
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53076

def language
  @language
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53090
53091
53092
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53090

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

#to_hashObject



53094
53095
53096
53097
53098
53099
53100
53101
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53094

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

#to_jsonObject



53086
53087
53088
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53086

def to_json
  JSON.dump(to_hash)
end