Class: Io::Flow::V0::Models::CatalogReference

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



30040
30041
30042
30043
30044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30040

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



30038
30039
30040
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30038

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30050
30051
30052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30050

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

#to_hashObject



30054
30055
30056
30057
30058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30054

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



30046
30047
30048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30046

def to_json
  JSON.dump(to_hash)
end