Class: Catalog::AmazonBuyBoxService::Decision
- Inherits:
-
Data
- Object
- Data
- Catalog::AmazonBuyBoxService::Decision
- Defined in:
- app/services/catalog/amazon_buy_box_service.rb
Overview
One item's outcome.
Instance Attribute Summary collapse
-
#action ⇒ Symbol
:price_lowered, :price_raised, :price_reverted, :flagged, :no_action.
-
#detail ⇒ Object?
The underlying lowering/raising Result, for callers that report on it (the daily run's blocked-by-external email).
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#source ⇒ Symbol?
Which rung of the ladder produced the target, or :maintenance for the raising path.
Instance Method Summary collapse
- #acted? ⇒ Boolean
-
#initialize(action:, reason: nil, price: nil, source: nil, detail: nil) ⇒ Decision
constructor
A new instance of Decision.
Constructor Details
#initialize(action:, reason: nil, price: nil, source: nil, detail: nil) ⇒ Decision
Returns a new instance of Decision.
59 |
# File 'app/services/catalog/amazon_buy_box_service.rb', line 59 def initialize(action:, reason: nil, price: nil, source: nil, detail: nil) = super |
Instance Attribute Details
#action ⇒ Symbol
Returns :price_lowered, :price_raised, :price_reverted, :flagged, :no_action.
58 59 60 61 62 |
# File 'app/services/catalog/amazon_buy_box_service.rb', line 58 Decision = Data.define(:action, :reason, :price, :source, :detail) do def initialize(action:, reason: nil, price: nil, source: nil, detail: nil) = super def acted? = action != :no_action end |
#detail ⇒ Object?
Returns the underlying lowering/raising Result, for callers
that report on it (the daily run's blocked-by-external email).
58 59 60 61 62 |
# File 'app/services/catalog/amazon_buy_box_service.rb', line 58 Decision = Data.define(:action, :reason, :price, :source, :detail) do def initialize(action:, reason: nil, price: nil, source: nil, detail: nil) = super def acted? = action != :no_action end |
#price ⇒ Object (readonly)
Returns the value of attribute price
58 59 60 |
# File 'app/services/catalog/amazon_buy_box_service.rb', line 58 def price @price end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason
58 59 60 |
# File 'app/services/catalog/amazon_buy_box_service.rb', line 58 def reason @reason end |
#source ⇒ Symbol?
Returns which rung of the ladder produced the target, or
:maintenance for the raising path.
58 59 60 61 62 |
# File 'app/services/catalog/amazon_buy_box_service.rb', line 58 Decision = Data.define(:action, :reason, :price, :source, :detail) do def initialize(action:, reason: nil, price: nil, source: nil, detail: nil) = super def acted? = action != :no_action end |
Instance Method Details
#acted? ⇒ Boolean
61 |
# File 'app/services/catalog/amazon_buy_box_service.rb', line 61 def acted? = action != :no_action |