Class: Io::Flow::V0::Models::PriceSourcePriceBookReference

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

Returns a new instance of PriceSourcePriceBookReference.



44874
44875
44876
44877
44878
44879
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44874

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



44872
44873
44874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44872

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



44872
44873
44874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44872

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



44885
44886
44887
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44885

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

#to_hashObject



44889
44890
44891
44892
44893
44894
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44889

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

#to_jsonObject



44881
44882
44883
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44881

def to_json
  JSON.dump(to_hash)
end