Module: ViewComponent::Instrumentation

Defined in:
lib/view_component/instrumentation.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



7
8
9
# File 'lib/view_component/instrumentation.rb', line 7

def self.included(mod)
  mod.prepend(self) unless ancestors.include?(ViewComponent::Instrumentation)
end

Instance Method Details

#render_in(view_context, &block) ⇒ Object



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

def render_in(view_context, &block)
  ActiveSupport::Notifications.instrument(
    notification_name,
    {
      name: self.class.name,
      identifier: self.class.source_location
    }
  ) do
    super
  end
end