Module: Highlight::Integrations::Rails
- Defined in:
- lib/highlight.rb
Defined Under Namespace
Modules: ClassMethods, ViewHelpers
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.included(base) ⇒ Object
252
253
254
255
256
257
258
259
260
261
|
# File 'lib/highlight.rb', line 252
def self.included(base)
base.extend(ClassMethods)
if base.respond_to?(:helper_method)
base.helper_method(:highlight_headers)
base.helper(ViewHelpers)
end
base.around_action(:with_highlight_context)
end
|
Instance Method Details
#with_highlight_context(&block) ⇒ Object
263
264
265
266
267
268
269
270
271
272
273
|
# File 'lib/highlight.rb', line 263
def with_highlight_context(&block)
return yield unless H.initialized?
H.instance.trace(
.session_id,
.request_id,
name: "#{request.method.upcase} #{request.path}",
&block
)
end
|