Class: Io::Flow::V0::Models::LandedCostItem
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LandedCostItem
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Tuple of item number, origin (from) country and destination (to) country
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LandedCostItem
constructor
A new instance of LandedCostItem.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ LandedCostItem
Returns a new instance of LandedCostItem.
48301 48302 48303 48304 48305 48306 48307 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48301 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:number, :origin, :destination], 'LandedCostItem') @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) @origin = HttpClient::Preconditions.assert_class('origin', opts.delete(:origin), String) @destination = HttpClient::Preconditions.assert_class('destination', opts.delete(:destination), String) end |
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
48299 48300 48301 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48299 def destination @destination end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
48299 48300 48301 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48299 def number @number end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
48299 48300 48301 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48299 def origin @origin end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
48313 48314 48315 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48313 def copy(incoming={}) LandedCostItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
48317 48318 48319 48320 48321 48322 48323 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48317 def to_hash { :number => number, :origin => origin, :destination => destination } end |
#to_json ⇒ Object
48309 48310 48311 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48309 def to_json JSON.dump(to_hash) end |