Class: Io::Flow::V0::Models::TaxDutyQuoteSimpleShipping

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

Overview

An ordered quantity of goods for tax and duty calculation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ TaxDutyQuoteSimpleShipping

Returns a new instance of TaxDutyQuoteSimpleShipping.



70157
70158
70159
70160
70161
70162
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70157

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:values, :ship_from], 'TaxDutyQuoteSimpleShipping')
  @values = (x = opts.delete(:values); x.is_a?(::Io::Flow::V0::Models::TaxDutyQuoteValues) ? x : ::Io::Flow::V0::Models::TaxDutyQuoteValues.new(x))
  @ship_from = (x = opts.delete(:ship_from); x.is_a?(::Io::Flow::V0::Models::StreetAddress) ? x : ::Io::Flow::V0::Models::StreetAddress.new(x))
end

Instance Attribute Details

#ship_fromObject (readonly)

Returns the value of attribute ship_from.



70155
70156
70157
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70155

def ship_from
  @ship_from
end

#valuesObject (readonly)

Returns the value of attribute values.



70155
70156
70157
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70155

def values
  @values
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



70168
70169
70170
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70168

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

#to_hashObject



70172
70173
70174
70175
70176
70177
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70172

def to_hash
  {
    :values => values.to_hash,
    :ship_from => ship_from.to_hash
  }
end

#to_jsonObject



70164
70165
70166
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70164

def to_json
  JSON.dump(to_hash)
end