Module: HoneycombRails::Extensions::ActionController::InstanceMethods
- Defined in:
- lib/honeycomb-rails/extensions/action_controller.rb
Instance Attribute Summary collapse
-
#honeycomb_metadata ⇒ Hash<String=>Any>
readonly
Hash of metadata to be added to the event we will send to Honeycomb for the current request.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#honeycomb_metadata ⇒ Hash<String=>Any> (readonly)
Hash of metadata to be added to the event we will send to Honeycomb for the current request.
To annotate the event with custom information (e.g. from a particular controller action), just add data to this hash: e.g.
[:num_posts] = @posts.size
35 36 37 |
# File 'lib/honeycomb-rails/extensions/action_controller.rb', line 35 def end |
Class Method Details
.included(controller_class) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/honeycomb-rails/extensions/action_controller.rb', line 5 def self.included(controller_class) super install_before_filter!(controller_class) do honeycomb_initialize end end |
.install_before_filter!(controller_class, &block) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/honeycomb-rails/extensions/action_controller.rb', line 13 def self.install_before_filter!(controller_class, &block) raise ArgumentError unless block_given? if ::Rails::VERSION::MAJOR < 4 controller_class.before_filter(&block) else controller_class.before_action(&block) end end |
Instance Method Details
#honeycomb_initialize ⇒ Object
22 23 24 |
# File 'lib/honeycomb-rails/extensions/action_controller.rb', line 22 def honeycomb_initialize = {} end |