Class: Io::Flow::V0::Models::SessionFormat

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

Returns a new instance of SessionFormat.



49199
49200
49201
49202
49203
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49199

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:currency], 'SessionFormat')
  @currency = (x = opts.delete(:currency); x.is_a?(::Io::Flow::V0::Models::SessionCurrencyFormat) ? x : ::Io::Flow::V0::Models::SessionCurrencyFormat.new(x))
end

Instance Attribute Details

#currencyObject (readonly)

Returns the value of attribute currency.



49197
49198
49199
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49197

def currency
  @currency
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49209
49210
49211
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49209

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

#to_hashObject



49213
49214
49215
49216
49217
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49213

def to_hash
  {
    :currency => currency.to_hash
  }
end

#to_jsonObject



49205
49206
49207
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49205

def to_json
  JSON.dump(to_hash)
end