Class: Pageflow::Quotas
- Inherits:
-
Object
- Object
- Pageflow::Quotas
- Defined in:
- lib/pageflow/quotas.rb
Instance Method Summary collapse
- #get(name, account) ⇒ Object
-
#initialize ⇒ Quotas
constructor
A new instance of Quotas.
- #register(name, factory) ⇒ Object
Constructor Details
#initialize ⇒ Quotas
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, account) @factories.fetch(name, Quota::Unlimited).new(name, account) end |
#register(name, factory) ⇒ Object
7 8 9 |
# File 'lib/pageflow/quotas.rb', line 7 def register(name, factory) @factories[name] = factory end |