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.



43978
43979
43980
43981
43982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43978

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.



43976
43977
43978
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43976

def currency
  @currency
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



43988
43989
43990
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43988

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

#to_hashObject



43992
43993
43994
43995
43996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43992

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

#to_jsonObject



43984
43985
43986
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43984

def to_json
  JSON.dump(to_hash)
end