Class: Eg::Book::MoneyDiscount
- Inherits:
-
Object
- Object
- Eg::Book::MoneyDiscount
- Defined in:
- lib/eg/book/calculate_discount_money.rb
Instance Method Summary collapse
-
#get_discount(amount) ⇒ Object
A 5 percent discount is provided whenever the total purchase is greater than $1,000.
Instance Method Details
#get_discount(amount) ⇒ Object
A 5 percent discount is provided whenever the total purchase is greater than $1,000
9 10 11 |
# File 'lib/eg/book/calculate_discount_money.rb', line 9 def get_discount amount (amount >= Money.new(1000)) ? (amount * 0.05) : Money.new end |