Class: Io::Flow::V0::Models::Carrier
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Carrier
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Partner that actually takes a shipment between places (ex: FedEx, DHL, SF Express)
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tracking_url ⇒ Object
readonly
Returns the value of attribute tracking_url.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Carrier
constructor
A new instance of Carrier.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Carrier
Returns a new instance of Carrier.
33802 33803 33804 33805 33806 33807 33808 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33802 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :name, :tracking_url], 'Carrier') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @tracking_url = HttpClient::Preconditions.assert_class('tracking_url', opts.delete(:tracking_url), String) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
33800 33801 33802 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33800 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
33800 33801 33802 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33800 def name @name end |
#tracking_url ⇒ Object (readonly)
Returns the value of attribute tracking_url.
33800 33801 33802 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33800 def tracking_url @tracking_url end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33814 33815 33816 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33814 def copy(incoming={}) Carrier.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
33818 33819 33820 33821 33822 33823 33824 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33818 def to_hash { :id => id, :name => name, :tracking_url => tracking_url } end |
#to_json ⇒ Object
33810 33811 33812 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33810 def to_json JSON.dump(to_hash) end |