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.



18574
18575
18576
18577
18578
18579
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18574

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

#numberObject (readonly)

Returns the value of attribute number.



18572
18573
18574
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18572

def number
  @number
end

#orderObject (readonly)

Returns the value of attribute order.



18572
18573
18574
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18572

def order
  @order
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



18585
18586
18587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18585

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

#to_hashObject



18589
18590
18591
18592
18593
18594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18589

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

#to_jsonObject



18581
18582
18583
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18581

def to_json
  JSON.dump(to_hash)
end