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



19065
19066
19067
19068
19069
19070
19071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19065

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.



19063
19064
19065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19063

def base
  @base
end

#marginObject (readonly)

Returns the value of attribute margin.



19063
19064
19065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19063

def margin
  @margin
end

#targetObject (readonly)

Returns the value of attribute target.



19063
19064
19065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19063

def target
  @target
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



19077
19078
19079
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19077

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

#to_hashObject



19081
19082
19083
19084
19085
19086
19087
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19081

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

#to_jsonObject



19073
19074
19075
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19073

def to_json
  JSON.dump(to_hash)
end