Class: Io::Flow::V0::Models::ReturnForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReturnForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#center_key ⇒ Object
readonly
Returns the value of attribute center_key.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#tier_id ⇒ Object
readonly
Returns the value of attribute tier_id.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ReturnForm
constructor
A new instance of ReturnForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ReturnForm
Returns a new instance of ReturnForm.
47997 47998 47999 48000 48001 48002 48003 48004 48005 48006 48007 48008 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47997 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:items], 'ReturnForm') @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ReturnLineItem) ? x : ::Io::Flow::V0::Models::ReturnLineItem.new(x)) } @tier_id = (x = opts.delete(:tier_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tier_id', x, String)) @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String)) @service = (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, String)) @destination = (x = opts.delete(:destination); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) @origin = (x = opts.delete(:origin); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))) @center_key = (x = opts.delete(:center_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('center_key', x, String)) end |
Instance Attribute Details
#center_key ⇒ Object (readonly)
Returns the value of attribute center_key.
47995 47996 47997 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47995 def center_key @center_key end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
47995 47996 47997 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47995 def destination @destination end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
47995 47996 47997 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47995 def items @items end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
47995 47996 47997 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47995 def key @key end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
47995 47996 47997 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47995 def order_number @order_number end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
47995 47996 47997 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47995 def origin @origin end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
47995 47996 47997 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47995 def service @service end |
#tier_id ⇒ Object (readonly)
Returns the value of attribute tier_id.
47995 47996 47997 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47995 def tier_id @tier_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
48014 48015 48016 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48014 def copy(incoming={}) ReturnForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
48018 48019 48020 48021 48022 48023 48024 48025 48026 48027 48028 48029 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48018 def to_hash { :items => items.map { |o| o.to_hash }, :tier_id => tier_id, :order_number => order_number, :service => service, :destination => destination.nil? ? nil : destination.to_hash, :key => key, :origin => origin.nil? ? nil : origin.to_hash, :center_key => center_key } end |
#to_json ⇒ Object
48010 48011 48012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48010 def to_json JSON.dump(to_hash) end |