Class: Io::Flow::V0::Models::OrganizationCurrencySettingForm

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrganizationCurrencySettingForm

Returns a new instance of OrganizationCurrencySettingForm.



22375
22376
22377
22378
22379
22380
22381
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22375

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

#baseObject (readonly)

Returns the value of attribute base.



22373
22374
22375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22373

def base
  @base
end

#marginObject (readonly)

Returns the value of attribute margin.



22373
22374
22375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22373

def margin
  @margin
end

#targetObject (readonly)

Returns the value of attribute target.



22373
22374
22375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22373

def target
  @target
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



22387
22388
22389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22387

def copy(incoming={})
  OrganizationCurrencySettingForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



22391
22392
22393
22394
22395
22396
22397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22391

def to_hash
  {
    :base => base,
    :target => target,
    :margin => margin
  }
end

#to_jsonObject



22383
22384
22385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22383

def to_json
  JSON.dump(to_hash)
end