Class: Io::Flow::V0::Models::FulfillmentExperienceReference

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

Returns a new instance of FulfillmentExperienceReference.



44055
44056
44057
44058
44059
44060
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44055

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

Instance Attribute Details

#currencyObject (readonly)

Returns the value of attribute currency.



44053
44054
44055
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44053

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



44053
44054
44055
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44053

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



44066
44067
44068
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44066

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

#to_hashObject



44070
44071
44072
44073
44074
44075
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44070

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

#to_jsonObject



44062
44063
44064
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44062

def to_json
  JSON.dump(to_hash)
end