Class: Io::Flow::V0::Models::OrganizationCurrencySettingUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#margin ⇒ Object
readonly
Returns the value of attribute margin.
-
#organization_currency_setting_id ⇒ Object
readonly
Returns the value of attribute organization_currency_setting_id.
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationCurrencySettingUpserted
constructor
A new instance of OrganizationCurrencySettingUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationCurrencySettingUpserted
Returns a new instance of OrganizationCurrencySettingUpserted.
13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13448 def initialize(incoming={}) super(:name => Event::Types::ORGANIZATION_CURRENCY_SETTING_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization_currency_setting_id, :organization_id, :base, :target, :margin], 'OrganizationCurrencySettingUpserted') @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String) @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @organization_currency_setting_id = HttpClient::Preconditions.assert_class('organization_currency_setting_id', opts.delete(:organization_currency_setting_id), String) @organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_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.
13446 13447 13448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446 def base @base end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
13446 13447 13448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446 def event_id @event_id end |
#margin ⇒ Object (readonly)
Returns the value of attribute margin.
13446 13447 13448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446 def margin @margin end |
#organization_currency_setting_id ⇒ Object (readonly)
Returns the value of attribute organization_currency_setting_id.
13446 13447 13448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446 def organization_currency_setting_id @organization_currency_setting_id end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
13446 13447 13448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446 def organization_id @organization_id end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
13446 13447 13448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446 def target @target end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
13446 13447 13448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
13465 13466 13467 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13465 def copy(incoming={}) OrganizationCurrencySettingUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13469 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization_currency_setting_id => organization_currency_setting_id, :organization_id => organization_id, :base => base, :target => target, :margin => margin } end |
#to_json ⇒ Object
13461 13462 13463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13461 def to_json JSON.dump(to_hash) end |