Class: Hola::Offer::StrawberryBulkDiscount

Inherits:
Hola::Offer
  • Object
show all
Defined in:
lib/hola/offer/strawberry_bulk_discount.rb

Constant Summary collapse

DISCOUNTED_PRICE =
BigDecimal("4.5")

Instance Attribute Summary

Attributes inherited from Hola::Offer

#quantity

Instance Method Summary collapse

Methods inherited from Hola::Offer

#initialize, #subtotal

Constructor Details

This class inherits a constructor from Hola::Offer

Instance Method Details

#applied?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/hola/offer/strawberry_bulk_discount.rb', line 18

def applied?
  eligible?
end

#nameObject



10
11
12
# File 'lib/hola/offer/strawberry_bulk_discount.rb', line 10

def name
  "Strawberry Bulk Discount"
end

#priceObject



14
15
16
# File 'lib/hola/offer/strawberry_bulk_discount.rb', line 14

def price
  eligible? ? DISCOUNTED_PRICE : super
end