Module: Saucy::Plan::InstanceMethods
- Defined in:
- lib/saucy/plan.rb
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
45 46 47 |
# File 'lib/saucy/plan.rb', line 45 def allows?(limit) limits.boolean.named(limit).allowed? end |
#billed? ⇒ Boolean
37 38 39 |
# File 'lib/saucy/plan.rb', line 37 def billed? !free? end |
#can_add_more?(limit, amount) ⇒ Boolean
41 42 43 |
# File 'lib/saucy/plan.rb', line 41 def can_add_more?(limit, amount) limits.numbered.named(limit).value > amount end |
#free? ⇒ Boolean
33 34 35 |
# File 'lib/saucy/plan.rb', line 33 def free? price.zero? end |
#limit(limit_name) ⇒ Object
49 50 51 |
# File 'lib/saucy/plan.rb', line 49 def limit(limit_name) limits.named(limit_name) end |