Module: PaperTrailDiff::Instrumentation

Defined in:
lib/paper_trail_diff/instrumentation.rb,
sig/generated/paper_trail_diff/instrumentation.rbs

Overview

Emits quiet, namespaced runtime events for application-owned diagnostics.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.comparison_payload(association_paths:, reload_live_endpoints:) ⇒ Object

Signature:

  • (association_paths: Array[String], reload_live_endpoints: bool) -> Hash[Symbol, untyped]



23
24
25
26
27
28
# File 'lib/paper_trail_diff/instrumentation.rb', line 23

def comparison_payload(association_paths:, reload_live_endpoints:)
  {
    association_paths: association_paths,
    reload_live_endpoints: reload_live_endpoints
  }
end

.instrument(event, payload) ⇒ Object

Signature:

  • (String | Symbol, Hash[Symbol, untyped]) { () -> untyped } -> untyped



12
13
14
15
16
17
18
19
20
# File 'lib/paper_trail_diff/instrumentation.rb', line 12

def instrument(event, payload, &)
  active_support = Object.const_get(:ActiveSupport) #: untyped
  notifications = active_support.const_get(:Notifications) #: untyped
  notifications.instrument(
    "#{event}.paper_trail_diff",
    payload,
    &
  )
end

Instance Method Details

#self?.comparison_payloadHash[Symbol, untyped]

: (association_paths: Array, reload_live_endpoints: bool) -> Hash[Symbol, untyped]

Parameters:

  • association_paths: (Array[String])
  • reload_live_endpoints: (Boolean)

Returns:

  • (Hash[Symbol, untyped])


10
# File 'sig/generated/paper_trail_diff/instrumentation.rbs', line 10

def self?.comparison_payload: (association_paths: Array[String], reload_live_endpoints: bool) -> Hash[Symbol, untyped]

#self?.instrument { ... } ⇒ Object

: (String | Symbol, Hash[Symbol, untyped]) { () -> untyped } -> untyped

Parameters:

  • (String, Symbol)
  • (Hash[Symbol, untyped])

Yields:

Yield Returns:

  • (Object)

Returns:

  • (Object)


7
# File 'sig/generated/paper_trail_diff/instrumentation.rbs', line 7

def self?.instrument: (String | Symbol, Hash[Symbol, untyped]) { () -> untyped } -> untyped