Module: Dependabot::SimpleInstrumentor

Defined in:
lib/dependabot/simple_instrumentor.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.eventsObject

Returns the value of attribute events.



7
8
9
# File 'lib/dependabot/simple_instrumentor.rb', line 7

def events
  @events
end

.subscribersObject

Returns the value of attribute subscribers.



7
8
9
# File 'lib/dependabot/simple_instrumentor.rb', line 7

def subscribers
  @subscribers
end

Class Method Details

.instrument(name, params = {}, &block) ⇒ Object



14
15
16
17
# File 'lib/dependabot/simple_instrumentor.rb', line 14

def instrument(name, params = {}, &block)
  @subscribers&.each { |s| s.call(name, params) }
  yield if block
end

.subscribe(&block) ⇒ Object



9
10
11
12
# File 'lib/dependabot/simple_instrumentor.rb', line 9

def subscribe(&block)
  @subscribers ||= []
  @subscribers << block
end