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.



49046
49047
49048
49049
49050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49046

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.



49044
49045
49046
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49044

def currency
  @currency
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49056
49057
49058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49056

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

#to_hashObject



49060
49061
49062
49063
49064
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49060

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

#to_jsonObject



49052
49053
49054
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49052

def to_json
  JSON.dump(to_hash)
end