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.



17026
17027
17028
17029
17030
17031
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17026

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.



17024
17025
17026
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17024

def number
  @number
end

#orderObject (readonly)

Returns the value of attribute order.



17024
17025
17026
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17024

def order
  @order
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



17037
17038
17039
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17037

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

#to_hashObject



17041
17042
17043
17044
17045
17046
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17041

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

#to_jsonObject



17033
17034
17035
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17033

def to_json
  JSON.dump(to_hash)
end