Class: Io::Flow::V0::Models::OrderIdentifierForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderIdentifierForm

Returns a new instance of OrderIdentifierForm.



16947
16948
16949
16950
16951
16952
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16947

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:order, :number], 'OrderIdentifierForm')
  @order = HttpClient::Preconditions.assert_class('order', opts.delete(:order), String)
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
end

Instance Attribute Details

#number ⇒ Object (readonly)

Returns the value of attribute number.



16945
16946
16947
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16945

def number
  @number
end

#order ⇒ Object (readonly)

Returns the value of attribute order.



16945
16946
16947
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16945

def order
  @order
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



16958
16959
16960
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16958

def copy(incoming={})
  OrderIdentifierForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hash ⇒ Object



16962
16963
16964
16965
16966
16967
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16962

def to_hash
  {
    :order => order,
    :number => number
  }
end

#to_json ⇒ Object



16954
16955
16956
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16954

def to_json
  JSON.dump(to_hash)
end