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.



36315
36316
36317
36318
36319
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36315

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.



36313
36314
36315
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36313

def currency
  @currency
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



36325
36326
36327
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36325

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

#to_hashObject



36329
36330
36331
36332
36333
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36329

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

#to_jsonObject



36321
36322
36323
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36321

def to_json
  JSON.dump(to_hash)
end