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.



37080
37081
37082
37083
37084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37080

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.



37078
37079
37080
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37078

def currency
  @currency
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37090
37091
37092
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37090

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

#to_hashObject



37094
37095
37096
37097
37098
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37094

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

#to_jsonObject



37086
37087
37088
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37086

def to_json
  JSON.dump(to_hash)
end