Class: Pageflow::Quotas

Inherits:
Object
  • Object
show all
Defined in:
lib/pageflow/quotas.rb

Instance Method Summary collapse

Constructor Details

#initializeQuotas

Returns a new instance of Quotas.



3
4
5
# File 'lib/pageflow/quotas.rb', line 3

def initialize
  @factories = HashWithIndifferentAccess.new
end

Instance Method Details

#get(name, account) ⇒ Object



11
12
13
# File 'lib/pageflow/quotas.rb', line 11

def get(name, )
  @factories.fetch(name, Quota::Unlimited).new(name, )
end

#register(name, factory) ⇒ Object



7
8
9
# File 'lib/pageflow/quotas.rb', line 7

def register(name, factory)
  @factories[name] = factory
end