Module: Saucy::Plan
Instance Method Summary collapse
- #allows?(limit) ⇒ Boolean
- #billed? ⇒ Boolean
- #can_add_more?(limit, amount) ⇒ Boolean
- #free? ⇒ Boolean
- #limit(limit_name) ⇒ Object
Instance Method Details
#allows?(limit) ⇒ Boolean
44 45 46 |
# File 'lib/saucy/plan.rb', line 44 def allows?(limit) limits.boolean.named(limit).allowed? end |
#billed? ⇒ Boolean
36 37 38 |
# File 'lib/saucy/plan.rb', line 36 def billed? !free? end |
#can_add_more?(limit, amount) ⇒ Boolean
40 41 42 |
# File 'lib/saucy/plan.rb', line 40 def can_add_more?(limit, amount) limits.numbered.named(limit).value > amount end |
#free? ⇒ Boolean
32 33 34 |
# File 'lib/saucy/plan.rb', line 32 def free? price.zero? end |
#limit(limit_name) ⇒ Object
48 49 50 |
# File 'lib/saucy/plan.rb', line 48 def limit(limit_name) limits.named(limit_name) end |