Class: Docit::Registry
- Inherits:
-
Object
- Object
- Docit::Registry
- Defined in:
- lib/docit/registry.rb
Overview
Central store for all documented operations.
Class Method Summary collapse
- .clear! ⇒ Object
- .find(controller:, action:) ⇒ Object
- .operations ⇒ Object
- .register(operation) ⇒ Object
Class Method Details
.clear! ⇒ Object
21 22 23 |
# File 'lib/docit/registry.rb', line 21 def clear! @operations = [] end |
.find(controller:, action:) ⇒ Object
15 16 17 18 19 |
# File 'lib/docit/registry.rb', line 15 def find(controller:, action:) operations.find do |op| op.controller == controller && op.action == action end end |
.operations ⇒ Object
7 8 9 |
# File 'lib/docit/registry.rb', line 7 def operations @operations ||= [] end |
.register(operation) ⇒ Object
11 12 13 |
# File 'lib/docit/registry.rb', line 11 def register(operation) operations << operation end |