class Discounts
Constants
- DISCOUNTS
Make this dynamic, allow users to pass in as many discount percentages as they want. Increment by one.
Public Class Methods
new(percentage_1, percentage_2, percentage_3)
click to toggle source
# File lib/discounter/discount.rb, line 3 def initialize(percentage_1, percentage_2, percentage_3) @tier_1 = percentage_1 @tier_2 = percentage_2 @tier_3 = percentage_3 end
Public Instance Methods
all()
click to toggle source
Instance based query method.
# File lib/discounter/discount.rb, line 24 def all DISCOUNTS.values.flatten.uniq end
select_helper()
click to toggle source
Helper for select methods in the HTML.
Should you want a dropdown to choose discount type.
# File lib/discounter/discount.rb, line 30 def select_helper DISCOUNTS['pretty_discounts'] end