Class: Io::Flow::V0::Models::OrganizationCurrencySettingForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrganizationCurrencySettingForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents the parts of an organization setting that can be updated.
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#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 = {}) ⇒ OrganizationCurrencySettingForm
constructor
A new instance of OrganizationCurrencySettingForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationCurrencySettingForm
Returns a new instance of OrganizationCurrencySettingForm.
41302 41303 41304 41305 41306 41307 41308 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41302 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:base, :target, :margin], 'OrganizationCurrencySettingForm') @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.
41300 41301 41302 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41300 def base @base end |
#margin ⇒ Object (readonly)
Returns the value of attribute margin.
41300 41301 41302 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41300 def margin @margin end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
41300 41301 41302 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41300 def target @target end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
41314 41315 41316 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41314 def copy(incoming={}) OrganizationCurrencySettingForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
41318 41319 41320 41321 41322 41323 41324 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41318 def to_hash { :base => base, :target => target, :margin => margin.to_f.to_s } end |
#to_json ⇒ Object
41310 41311 41312 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41310 def to_json JSON.dump(to_hash) end |