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.



60802
60803
60804
60805
60806
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60802

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.



60800
60801
60802
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60800

def currency
  @currency
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



60812
60813
60814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60812

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

#to_hashObject



60816
60817
60818
60819
60820
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60816

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

#to_jsonObject



60808
60809
60810
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60808

def to_json
  JSON.dump(to_hash)
end