Class: Io::Flow::V0::Models::SessionFormat
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SessionFormat
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SessionFormat
constructor
A new instance of SessionFormat.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SessionFormat
Returns a new instance of SessionFormat.
47730 47731 47732 47733 47734 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47730 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
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
47728 47729 47730 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47728 def currency @currency end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
47740 47741 47742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47740 def copy(incoming={}) SessionFormat.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
47744 47745 47746 47747 47748 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47744 def to_hash { :currency => currency.to_hash } end |
#to_json ⇒ Object
47736 47737 47738 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47736 def to_json JSON.dump(to_hash) end |