Class: Io::Flow::V0::Models::ChannelCurrencyUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#channel_currency ⇒ Object
readonly
Returns the value of attribute channel_currency.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ChannelCurrencyUpserted
constructor
A new instance of ChannelCurrencyUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ ChannelCurrencyUpserted
Returns a new instance of ChannelCurrencyUpserted.
32223 32224 32225 32226 32227 32228 32229 32230 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32223 def initialize(incoming={}) super(:discriminator => Event::Types::CHANNEL_CURRENCY_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :channel_currency], 'ChannelCurrencyUpserted') @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) @channel_currency = (x = opts.delete(:channel_currency); x.is_a?(::Io::Flow::Channel::Internal::V0::Models::ChannelCurrency) ? x : ::Io::Flow::Channel::Internal::V0::Models::ChannelCurrency.new(x)) end |
Instance Attribute Details
#channel_currency ⇒ Object (readonly)
Returns the value of attribute channel_currency.
32221 32222 32223 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32221 def channel_currency @channel_currency end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
32221 32222 32223 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32221 def event_id @event_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
32221 32222 32223 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32221 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
32236 32237 32238 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32236 def copy(incoming={}) ChannelCurrencyUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
32240 32241 32242 32243 32244 32245 32246 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32240 def subtype_to_hash { :event_id => event_id, :timestamp => , :channel_currency => channel_currency.to_hash } end |
#to_json ⇒ Object
32232 32233 32234 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32232 def to_json JSON.dump(to_hash) end |