Method: Datadog::Core::Utils::Time.now_provider=

Defined in:
lib/datadog/core/utils/time.rb

.now_provider=(block) ⇒ Object

Overrides the implementation of ‘#now with the provided callable.

Overriding the method ‘#now` instead of indirectly calling `block` removes one level of method call overhead.

Parameters:

  • block (Proc)

    block that returns a ‘Time` object representing the current wall time

[View source]

33
34
35
# File 'lib/datadog/core/utils/time.rb', line 33

def now_provider=(block)
  define_singleton_method(:now, &block)
end