Class: Io::Flow::V0::Models::OrderServiceChange
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderServiceChange
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Manual change for a shipping method used for an order. Currently only available to orders with a single calculated delivery.
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderServiceChange
constructor
A new instance of OrderServiceChange.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderServiceChange
Returns a new instance of OrderServiceChange.
41327 41328 41329 41330 41331 41332 41333 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41327 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :from, :to], 'OrderServiceChange') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @from = (x = opts.delete(:from); x.is_a?(::Io::Flow::V0::Models::CarrierService) ? x : ::Io::Flow::V0::Models::CarrierService.new(x)) @to = (x = opts.delete(:to); x.is_a?(::Io::Flow::V0::Models::CarrierService) ? x : ::Io::Flow::V0::Models::CarrierService.new(x)) end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
41325 41326 41327 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41325 def from @from end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
41325 41326 41327 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41325 def id @id end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
41325 41326 41327 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41325 def to @to end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
41339 41340 41341 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41339 def copy(incoming={}) OrderServiceChange.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
41343 41344 41345 41346 41347 41348 41349 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41343 def to_hash { :id => id, :from => from.to_hash, :to => to.to_hash } end |
#to_json ⇒ Object
41335 41336 41337 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41335 def to_json JSON.dump(to_hash) end |