Class: Io::Flow::V0::Models::TaxDutyQuoteSimpleShipping
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TaxDutyQuoteSimpleShipping
- 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
-
#ship_from ⇒ Object
readonly
Returns the value of attribute ship_from.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TaxDutyQuoteSimpleShipping
constructor
A new instance of TaxDutyQuoteSimpleShipping.
- #to_hash ⇒ Object
- #to_json ⇒ Object
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_from ⇒ Object (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 |
#values ⇒ Object (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_hash ⇒ Object
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_json ⇒ Object
70164 70165 70166 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70164 def to_json JSON.dump(to_hash) end |