Class: Io::Flow::V0::Models::AllocationTotals
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AllocationTotals
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AllocationTotals
constructor
A new instance of AllocationTotals.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ AllocationTotals
9443 9444 9445 9446 9447 9448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9443 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:target, :base], 'AllocationTotals') @target = HttpClient::Preconditions.assert_class('target', HttpClient::Helper.to_big_decimal(opts.delete(:target)), BigDecimal) @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal) end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
9441 9442 9443 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9441 def base @base end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
9441 9442 9443 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9441 def target @target end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
9454 9455 9456 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9454 def copy(incoming={}) AllocationTotals.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
9458 9459 9460 9461 9462 9463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9458 def to_hash { :target => target, :base => base } end |
#to_json ⇒ Object
9450 9451 9452 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9450 def to_json JSON.dump(to_hash) end |