Class: PricingPlans::LimitableRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/pricing_plans/limit_checker.rb

Overview

Registry for Limitable counters

Class Method Summary collapse

Class Method Details

.clear!Object



155
156
157
# File 'lib/pricing_plans/limit_checker.rb', line 155

def clear!
  @counters = {}
end

.counter_for(limit_key) ⇒ Object



147
148
149
# File 'lib/pricing_plans/limit_checker.rb', line 147

def counter_for(limit_key)
  counters[limit_key.to_sym]
end

.countersObject



151
152
153
# File 'lib/pricing_plans/limit_checker.rb', line 151

def counters
  @counters ||= {}
end

.register_counter(limit_key, &block) ⇒ Object



143
144
145
# File 'lib/pricing_plans/limit_checker.rb', line 143

def register_counter(limit_key, &block)
  counters[limit_key.to_sym] = block
end