Class: ChupaText::DecomposerRegistry
- Inherits:
-
Object
- Object
- ChupaText::DecomposerRegistry
- Includes:
- Enumerable
- Defined in:
- lib/chupa-text/decomposer-registry.rb
Instance Method Summary collapse
-
#each(&block) ⇒ Object
-
#find(name) ⇒ Object
-
#initialize ⇒ DecomposerRegistry
constructor
A new instance of DecomposerRegistry.
-
#register(name, decomposer_class) ⇒ Object
Constructor Details
#initialize ⇒ DecomposerRegistry
Returns a new instance of DecomposerRegistry.
21 22 23 |
# File 'lib/chupa-text/decomposer-registry.rb', line 21 def initialize @decomposer_classes = {} end |
Instance Method Details
#each(&block) ⇒ Object
33 34 35 |
# File 'lib/chupa-text/decomposer-registry.rb', line 33 def each(&block) @decomposer_classes.each(&block) end |
#find(name) ⇒ Object
29 30 31 |
# File 'lib/chupa-text/decomposer-registry.rb', line 29 def find(name) @decomposer_classes[name] end |
#register(name, decomposer_class) ⇒ Object
25 26 27 |
# File 'lib/chupa-text/decomposer-registry.rb', line 25 def register(name, decomposer_class) @decomposer_classes[name] = decomposer_class end |