Class: Textus::Workflow::Registry
- Inherits:
-
Object
- Object
- Textus::Workflow::Registry
- Defined in:
- lib/textus/workflow/registry.rb
Instance Method Summary collapse
- #all ⇒ Object
- #for(key) ⇒ Object
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
- #register(definition) ⇒ Object
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry.
4 5 6 |
# File 'lib/textus/workflow/registry.rb', line 4 def initialize @definitions = [] end |
Instance Method Details
#all ⇒ Object
16 17 18 |
# File 'lib/textus/workflow/registry.rb', line 16 def all @definitions.dup end |
#for(key) ⇒ Object
12 13 14 |
# File 'lib/textus/workflow/registry.rb', line 12 def for(key) @definitions.find { |d| d.match?(key) } end |
#register(definition) ⇒ Object
8 9 10 |
# File 'lib/textus/workflow/registry.rb', line 8 def register(definition) @definitions << definition end |