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.



11731
11732
11733
11734
11735
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11731

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



11729
11730
11731
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11729

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



11741
11742
11743
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11741

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

#to_hashObject



11745
11746
11747
11748
11749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11745

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



11737
11738
11739
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11737

def to_json
  JSON.dump(to_hash)
end