Class: Io::Flow::V0::Models::OrderIdentifier
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderIdentifier
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents alternate numbers with which to identify an order.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderIdentifier
constructor
A new instance of OrderIdentifier.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderIdentifier
Returns a new instance of OrderIdentifier.
21849 21850 21851 21852 21853 21854 21855 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21849 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :order, :number], 'OrderIdentifier') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderReference) ? x : ::Io::Flow::V0::Models::OrderReference.new(x)) @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
21847 21848 21849 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21847 def id @id end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
21847 21848 21849 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21847 def number @number end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
21847 21848 21849 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21847 def order @order end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
21861 21862 21863 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21861 def copy(incoming={}) OrderIdentifier.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
21865 21866 21867 21868 21869 21870 21871 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21865 def to_hash { :id => id, :order => order.to_hash, :number => number } end |
#to_json ⇒ Object
21857 21858 21859 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21857 def to_json JSON.dump(to_hash) end |