Class: Io::Flow::V0::Models::CartReference

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



11453
11454
11455
11456
11457
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11453

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



11451
11452
11453
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11451

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



11463
11464
11465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11463

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

#to_hashObject



11467
11468
11469
11470
11471
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11467

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



11459
11460
11461
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11459

def to_json
  JSON.dump(to_hash)
end