Module: Saucy::Plan::InstanceMethods

Defined in:
lib/saucy/plan.rb

Instance Method Summary collapse

Instance Method Details

#allows?(limit) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/saucy/plan.rb', line 45

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

#billed?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/saucy/plan.rb', line 37

def billed?
  !free?
end

#can_add_more?(limit, amount) ⇒ Boolean

Returns:

  • (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

Returns:

  • (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