Class: Logster::IgnorePattern
- Inherits:
-
Object
- Object
- Logster::IgnorePattern
- Defined in:
- lib/logster/ignore_pattern.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message_pattern = nil, env_patterns = nil) ⇒ IgnorePattern
constructor
A new instance of IgnorePattern.
- #matches?(message) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(message_pattern = nil, env_patterns = nil) ⇒ IgnorePattern
Returns a new instance of IgnorePattern.
6 7 8 9 |
# File 'lib/logster/ignore_pattern.rb', line 6 def initialize( = nil, env_patterns = nil) @msg_match = @env_match = env_patterns end |
Class Method Details
.from_message_and_request_uri(msg, request) ⇒ Object
11 12 13 |
# File 'lib/logster/ignore_pattern.rb', line 11 def self.(msg, request) IgnorePattern.new(msg, REQUEST_URI: request) end |
Instance Method Details
#matches?(message) ⇒ Boolean
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/logster/ignore_pattern.rb', line 15 def matches?() if @msg_match return false unless compare(., @msg_match) end if @env_match return false unless compare(.env, @env_match) end true end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/logster/ignore_pattern.rb', line 27 def to_s "<#Logster::IgnorePattern, msg_match: #{@msg_match.inspect}, env_match: #{@env_match.inspect}>" end |