Class: Io::Flow::V0::Models::OrderReference

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 = {}) ⇒ OrderReference

Returns a new instance of OrderReference.



14798
14799
14800
14801
14802
14803
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14798

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



14796
14797
14798
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14796

def id
  @id
end

#numberObject (readonly)

Returns the value of attribute number.



14796
14797
14798
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14796

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



14809
14810
14811
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14809

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

#to_hashObject



14813
14814
14815
14816
14817
14818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14813

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

#to_jsonObject



14805
14806
14807
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14805

def to_json
  JSON.dump(to_hash)
end