Class: Corzinus::Checkout::DeliveryStep

Inherits:
Rectify::Command
  • Object
show all
Defined in:
app/commands/corzinus/checkout/delivery_step.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ DeliveryStep

Returns a new instance of DeliveryStep.



6
7
8
9
# File 'app/commands/corzinus/checkout/delivery_step.rb', line 6

def initialize(options)
  @order = options[:order]
  @delivery_id = options[:params][:delivery_id]
end

Instance Attribute Details

#delivery_idObject (readonly)

Returns the value of attribute delivery_id.



4
5
6
# File 'app/commands/corzinus/checkout/delivery_step.rb', line 4

def delivery_id
  @delivery_id
end

#orderObject (readonly)

Returns the value of attribute order.



4
5
6
# File 'app/commands/corzinus/checkout/delivery_step.rb', line 4

def order
  @order
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
# File 'app/commands/corzinus/checkout/delivery_step.rb', line 11

def call
  if delivery_id_valid? && order_update
    broadcast :valid
  else
    broadcast :invalid
  end
end