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



18117
18118
18119
18120
18121
18122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18117

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.



18115
18116
18117
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18115

def number
  @number
end

#orderObject (readonly)

Returns the value of attribute order.



18115
18116
18117
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18115

def order
  @order
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



18128
18129
18130
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18128

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

#to_hashObject



18132
18133
18134
18135
18136
18137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18132

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

#to_jsonObject



18124
18125
18126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18124

def to_json
  JSON.dump(to_hash)
end