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.



11482
11483
11484
11485
11486
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11482

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.



11480
11481
11482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11480

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



11492
11493
11494
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11492

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

#to_hashObject



11496
11497
11498
11499
11500
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11496

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



11488
11489
11490
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11488

def to_json
  JSON.dump(to_hash)
end