Module: Saucy::Plan::InstanceMethods

Defined in:
lib/saucy/plan.rb

Instance Method Summary collapse

Instance Method Details

#allows?(limit) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/saucy/plan.rb', line 25

def allows?(limit)
  limits.boolean.named(limit).allowed?
end

#billed?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/saucy/plan.rb', line 17

def billed?
  !free?
end

#can_add_more?(limit, amount) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/saucy/plan.rb', line 21

def can_add_more?(limit, amount)
  limits.numbered.named(limit).value > amount
end

#free?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/saucy/plan.rb', line 13

def free?
  price.zero?
end

#limit(limit_name) ⇒ Object



29
30
31
# File 'lib/saucy/plan.rb', line 29

def limit(limit_name)
  limits.named(limit_name)
end