Class: Docit::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/docit/registry.rb

Overview

Central store for all documented operations.

Class Method Summary collapse

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

.operationsObject



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