mirror of https://github.com/freeCodeCamp/devdocs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
297 B
15 lines
297 B
11 years ago
|
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
|