module AppfluxRuby::Rails::ControllerMethods::ClassMethods

Public Instance Methods

before_bugflux_notify(*methods) click to toggle source
# File lib/appflux_ruby/rails/controller_methods.rb, line 11
def before_bugflux_notify(*methods)
  run_bugflux_callbacks(methods) do
  end
end

Private Instance Methods

run_bugflux_callbacks(__methods) click to toggle source
# File lib/appflux_ruby/rails/controller_methods.rb, line 18
def run_bugflux_callbacks(__methods)
  filtered_methods = __methods.last.is_a?(::Hash) ? __methods.pop : {}

  @@custom_message = AppfluxRuby::MessageBuilders::CustomMessage.new

  if respond_to?(:before_action)
    before_action filtered_methods do |controller|
      __methods.each do |_method|
        controller.send(_method, @@custom_message)
      end
    end
  else
    before_filter filtered_methods do |controller|
      __methods.each do |_method|
        controller.send(_method, @@custom_message)
      end
    end
  end
end