Class: Io::Flow::V0::Models::OrganizationCurrencySetting
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrganizationCurrencySetting
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents organization-specific currency conversion adjustments.
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#margin ⇒ Object
readonly
Returns the value of attribute margin.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationCurrencySetting
constructor
A new instance of OrganizationCurrencySetting.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationCurrencySetting
18575 18576 18577 18578 18579 18580 18581 18582 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18575 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :base, :target, :margin], 'OrganizationCurrencySetting') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String) @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String) @margin = HttpClient::Preconditions.assert_class('margin', HttpClient::Helper.to_big_decimal(opts.delete(:margin)), BigDecimal) end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
18573 18574 18575 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18573 def base @base end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
18573 18574 18575 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18573 def id @id end |
#margin ⇒ Object (readonly)
Returns the value of attribute margin.
18573 18574 18575 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18573 def margin @margin end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
18573 18574 18575 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18573 def target @target end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
18588 18589 18590 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18588 def copy(incoming={}) OrganizationCurrencySetting.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
18592 18593 18594 18595 18596 18597 18598 18599 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18592 def to_hash { :id => id, :base => base, :target => target, :margin => margin } end |
#to_json ⇒ Object
18584 18585 18586 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18584 def to_json JSON.dump(to_hash) end |