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.
34976 34977 34978 34979 34980 34981 34982 34983 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34976 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::V0::Models::ChannelCurrency) ? x : ::Io::Flow::V0::Models::ChannelCurrency.new(x)) end |
Instance Attribute Details
#channel_currency ⇒ Object (readonly)
Returns the value of attribute channel_currency.
34974 34975 34976 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34974 def channel_currency @channel_currency end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
34974 34975 34976 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34974 def event_id @event_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
34974 34975 34976 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34974 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
34989 34990 34991 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34989 def copy(incoming={}) ChannelCurrencyUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
34993 34994 34995 34996 34997 34998 34999 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34993 def subtype_to_hash { :event_id => event_id, :timestamp => , :channel_currency => channel_currency.to_hash } end |
#to_json ⇒ Object
34985 34986 34987 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34985 def to_json JSON.dump(to_hash) end |