Class: Lita::Interactors::ResetQuantity
- Inherits:
-
BaseInteractor
- Object
- BaseInteractor
- Lita::Interactors::ResetQuantity
- Includes:
- Helpers::MessagesHelper
- Defined in:
- lib/lita/interactors/reset_quantity.rb
Overview
Set the customer quantity to zero
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Attributes inherited from BaseInteractor
Instance Method Summary collapse
-
#initialize(handler, data) ⇒ ResetQuantity
constructor
A new instance of ResetQuantity.
- #perform ⇒ Object
Methods included from Helpers::MessagesHelper
#msg_customer_duplicated, #msg_customer_not_found, #msg_duplicated, #msg_not_found
Methods inherited from BaseInteractor
Constructor Details
#initialize(handler, data) ⇒ ResetQuantity
Returns a new instance of ResetQuantity.
12 13 14 15 |
# File 'lib/lita/interactors/reset_quantity.rb', line 12 def initialize(handler, data) @handler = handler @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/lita/interactors/reset_quantity.rb', line 10 def data @data end |
Instance Method Details
#perform ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/lita/interactors/reset_quantity.rb', line 17 def perform if service_exists? update_costumer_if_exist else @error = msg_not_found(service_name: name) end self end |