Class: Io::Flow::V0::Models::EmailNotificationAbandonedOrder
- Inherits:
-
EmailNotificationData
- Object
- EmailNotificationData
- Io::Flow::V0::Models::EmailNotificationAbandonedOrder
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Data about an abandoned order. Today at Flow, this can be triggered by a consumer initating checkout (without completing)
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#promotion ⇒ Object
readonly
Returns the value of attribute promotion.
-
#urls ⇒ Object
readonly
Returns the value of attribute urls.
Attributes inherited from EmailNotificationData
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ EmailNotificationAbandonedOrder
constructor
A new instance of EmailNotificationAbandonedOrder.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from EmailNotificationData
Constructor Details
#initialize(incoming = {}) ⇒ EmailNotificationAbandonedOrder
Returns a new instance of EmailNotificationAbandonedOrder.
37592 37593 37594 37595 37596 37597 37598 37599 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37592 def initialize(incoming={}) super(:discriminator => EmailNotificationData::Types::EMAIL_NOTIFICATION_ABANDONED_ORDER) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:order, :urls], 'EmailNotificationAbandonedOrder') @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderSummary) ? x : ::Io::Flow::V0::Models::OrderSummary.new(x)) @urls = (x = opts.delete(:urls); x.is_a?(::Io::Flow::V0::Models::EmailAbandonedOrderUrls) ? x : ::Io::Flow::V0::Models::EmailAbandonedOrderUrls.new(x)) @promotion = (x = opts.delete(:promotion); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::EmailAbandonedOrderPromotion) ? x : ::Io::Flow::V0::Models::EmailAbandonedOrderPromotion.new(x))) end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
37590 37591 37592 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37590 def order @order end |
#promotion ⇒ Object (readonly)
Returns the value of attribute promotion.
37590 37591 37592 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37590 def promotion @promotion end |
#urls ⇒ Object (readonly)
Returns the value of attribute urls.
37590 37591 37592 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37590 def urls @urls end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
37605 37606 37607 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37605 def copy(incoming={}) EmailNotificationAbandonedOrder.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
37609 37610 37611 37612 37613 37614 37615 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37609 def subtype_to_hash { :order => order.to_hash, :urls => urls.to_hash, :promotion => promotion.nil? ? nil : promotion.to_hash } end |
#to_json ⇒ Object
37601 37602 37603 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37601 def to_json JSON.dump(to_hash) end |