mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
14 lines
297 B
Ruby
14 lines
297 B
Ruby
module FakeInstrumentation
|
|
def instrument(event, payload = nil)
|
|
(@instrumentations ||= []) << { event: event, payload: payload }
|
|
yield payload if block_given?
|
|
end
|
|
|
|
def instrumentations
|
|
@instrumentations
|
|
end
|
|
|
|
def last_instrumentation
|
|
@instrumentations.try :last
|
|
end
|
|
end
|