Class: SelectRailsLog::Filter::ControllerActionFilter
- Inherits:
-
BaseFilter
- Object
- Extension
- BaseFilter
- SelectRailsLog::Filter::ControllerActionFilter
- Defined in:
- lib/select_rails_log/filter/controller_action_filter.rb
Constant Summary
Constants included from Constants
Constants::ACTION, Constants::CLIENT, Constants::COMPLETED, Constants::CONTROLLER, Constants::DEBUG, Constants::DEFAULT_OUTPUT, Constants::DURATION, Constants::HTTP_METHOD, Constants::HTTP_STATUS, Constants::ID, Constants::INTERVAL, Constants::LOGS, Constants::MESSAGE, Constants::PARAMETERS, Constants::PATH, Constants::PERFORMANCE, Constants::PERFORMANCE_ACTIVE_RECORD, Constants::PERFORMANCE_ALLOCATIONS, Constants::PERFORMANCE_VIEWS, Constants::PID, Constants::RAW_LOGS, Constants::REQUEST_ID, Constants::SEVERITY, Constants::STARTED, Constants::TIME
Instance Attribute Summary
Attributes inherited from Extension
Instance Method Summary collapse
-
#initialize ⇒ ControllerActionFilter
constructor
A new instance of ControllerActionFilter.
- #run(data) ⇒ Object
- #runnable? ⇒ Boolean
Methods inherited from BaseFilter
filter_type, #line_filter?, #request_filter?
Methods inherited from Extension
Constructor Details
#initialize ⇒ ControllerActionFilter
Returns a new instance of ControllerActionFilter.
15 16 17 18 |
# File 'lib/select_rails_log/filter/controller_action_filter.rb', line 15 def initialize(...) super @controller_actions = controller_actions([:pattern]) end |
Instance Method Details
#run(data) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/select_rails_log/filter/controller_action_filter.rb', line 24 def run(data) @controller_actions.any? do |controller, action| data[CONTROLLER] == controller && (action.nil? || data[ACTION] == action) end end |
#runnable? ⇒ Boolean
20 21 22 |
# File 'lib/select_rails_log/filter/controller_action_filter.rb', line 20 def runnable? !!@controller_actions end |