Class: Workarea::Checkout::Steps::Base

Inherits:
Object
  • Object
show all
Defined in:
app/models/workarea/checkout/steps/base.rb

Direct Known Subclasses

Addresses, Payment, Shipping

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(checkout) ⇒ Base

Returns a new instance of Base.



10
11
12
# File 'app/models/workarea/checkout/steps/base.rb', line 10

def initialize(checkout)
  @checkout = checkout
end

Instance Attribute Details

#checkoutObject (readonly)

Returns the value of attribute checkout.



5
6
7
# File 'app/models/workarea/checkout/steps/base.rb', line 5

def checkout
  @checkout
end

Instance Method Details

#complete?Boolean

Whether this checkout step is finished. Used for redirecting and summary display in checkout.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


29
30
31
# File 'app/models/workarea/checkout/steps/base.rb', line 29

def complete?
  raise(NotImplementedError, "#{self.class} must implement the #complete? method")
end

#update(params = {}) ⇒ Boolean

Update data related to current step of checkout

Parameters:

  • params (Hash) (defaults to: {})

Returns:

  • (Boolean)

    whether the update succeeded

Raises:

  • (NotImplementedError)


20
21
22
# File 'app/models/workarea/checkout/steps/base.rb', line 20

def update(params = {})
  raise(NotImplementedError, "#{self.class} must implement the #update method")
end