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.



26587
26588
26589
26590
26591
26592
26593
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26587

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.



26585
26586
26587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26585

def base
  @base
end

#marginObject (readonly)

Returns the value of attribute margin.



26585
26586
26587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26585

def margin
  @margin
end

#targetObject (readonly)

Returns the value of attribute target.



26585
26586
26587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26585

def target
  @target
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26599
26600
26601
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26599

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

#to_hashObject



26603
26604
26605
26606
26607
26608
26609
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26603

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

#to_jsonObject



26595
26596
26597
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26595

def to_json
  JSON.dump(to_hash)
end