Class: SelectRailsLog::Filter::HttpMethodFilter

Inherits:
BaseFilter show all
Defined in:
lib/select_rails_log/filter/http_method_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

#options

Instance Method Summary collapse

Methods inherited from BaseFilter

filter_type, #line_filter?, #request_filter?

Methods inherited from Extension

option_initializers

Constructor Details

#initializeHttpMethodFilter

Returns a new instance of HttpMethodFilter.



12
13
14
15
# File 'lib/select_rails_log/filter/http_method_filter.rb', line 12

def initialize(...)
  super
  @http_method = options[:http_method]&.upcase
end

Instance Method Details

#run(data) ⇒ Object



21
22
23
# File 'lib/select_rails_log/filter/http_method_filter.rb', line 21

def run(data)
  data[HTTP_METHOD] == @http_method
end

#runnable?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/select_rails_log/filter/http_method_filter.rb', line 17

def runnable?
  !!@http_method
end