Class: Io::Flow::V0::Models::SpotRateUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#effective_at ⇒ Object
readonly
Returns the value of attribute effective_at.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#spot_rate_id ⇒ Object
readonly
Returns the value of attribute spot_rate_id.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SpotRateUpserted
constructor
A new instance of SpotRateUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ SpotRateUpserted
Returns a new instance of SpotRateUpserted.
17483 17484 17485 17486 17487 17488 17489 17490 17491 17492 17493 17494 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17483 def initialize(incoming={}) super(:name => Event::Types::SPOT_RATE_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :spot_rate_id, :base, :target, :value, :effective_at], 'SpotRateUpserted') @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) @spot_rate_id = HttpClient::Preconditions.assert_class('spot_rate_id', opts.delete(:spot_rate_id), String) @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String) @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String) @value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal) @effective_at = HttpClient::Preconditions.assert_class('effective_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:effective_at)), DateTime) end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
17481 17482 17483 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17481 def base @base end |
#effective_at ⇒ Object (readonly)
Returns the value of attribute effective_at.
17481 17482 17483 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17481 def effective_at @effective_at end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
17481 17482 17483 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17481 def event_id @event_id end |
#spot_rate_id ⇒ Object (readonly)
Returns the value of attribute spot_rate_id.
17481 17482 17483 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17481 def spot_rate_id @spot_rate_id end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
17481 17482 17483 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17481 def target @target end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
17481 17482 17483 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17481 def @timestamp end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
17481 17482 17483 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17481 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
17500 17501 17502 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17500 def copy(incoming={}) SpotRateUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
17504 17505 17506 17507 17508 17509 17510 17511 17512 17513 17514 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17504 def subtype_to_hash { :event_id => event_id, :timestamp => , :spot_rate_id => spot_rate_id, :base => base, :target => target, :value => value, :effective_at => effective_at } end |
#to_json ⇒ Object
17496 17497 17498 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17496 def to_json JSON.dump(to_hash) end |