Class: Corzinus::Checkout::AccessStep
- Inherits:
-
Rectify::Command
- Object
- Rectify::Command
- Corzinus::Checkout::AccessStep
- Defined in:
- app/commands/corzinus/checkout/access_step.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#step ⇒ Object
readonly
Returns the value of attribute step.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(order, step) ⇒ AccessStep
constructor
A new instance of AccessStep.
Constructor Details
#initialize(order, step) ⇒ AccessStep
Returns a new instance of AccessStep.
6 7 8 9 |
# File 'app/commands/corzinus/checkout/access_step.rb', line 6 def initialize(order, step) @order = order @step = step end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
4 5 6 |
# File 'app/commands/corzinus/checkout/access_step.rb', line 4 def order @order end |
#step ⇒ Object (readonly)
Returns the value of attribute step.
4 5 6 |
# File 'app/commands/corzinus/checkout/access_step.rb', line 4 def step @step end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 |
# File 'app/commands/corzinus/checkout/access_step.rb', line 11 def call if order.items_count.zero? && step != :complete return broadcast(:empty_cart) end allow? ? broadcast(:allow) : broadcast(:not_allow) end |