Class: Io::Flow::V0::Models::MonthlyAverageVolume
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::MonthlyAverageVolume
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ MonthlyAverageVolume
constructor
A new instance of MonthlyAverageVolume.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ MonthlyAverageVolume
Returns a new instance of MonthlyAverageVolume.
50549 50550 50551 50552 50553 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50549 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal)) @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
50547 50548 50549 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50547 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
50547 50548 50549 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50547 def currency @currency end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
50559 50560 50561 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50559 def copy(incoming={}) MonthlyAverageVolume.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
50563 50564 50565 50566 50567 50568 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50563 def to_hash { :amount => amount.to_f.to_s, :currency => currency } end |
#to_json ⇒ Object
50555 50556 50557 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50555 def to_json JSON.dump(to_hash) end |