Class: Corzinus::UpdateOrder
- Inherits:
-
Rectify::Command
- Object
- Rectify::Command
- Corzinus::UpdateOrder
- Defined in:
- app/commands/corzinus/update_order.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(order, params) ⇒ UpdateOrder
constructor
A new instance of UpdateOrder.
Constructor Details
#initialize(order, params) ⇒ UpdateOrder
Returns a new instance of UpdateOrder.
5 6 7 8 |
# File 'app/commands/corzinus/update_order.rb', line 5 def initialize(order, params) @order = order @params = params end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
3 4 5 |
# File 'app/commands/corzinus/update_order.rb', line 3 def order @order end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'app/commands/corzinus/update_order.rb', line 3 def params @params end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/commands/corzinus/update_order.rb', line 10 def call if coupon_valid? && update_order type = params[:to_checkout] ? :to_checkout : :valid broadcast type else broadcast :invalid, coupon_form end end |