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.
4 5 6 7 |
# File 'lib/logster/ignore_pattern.rb', line 4 def initialize(=nil, env_patterns=nil) @msg_match = @env_match = env_patterns end |
Class Method Details
.from_message_and_request_uri(msg, request) ⇒ Object
9 10 11 |
# File 'lib/logster/ignore_pattern.rb', line 9 def self.(msg, request) IgnorePattern.new(msg, {REQUEST_URI: request}) end |
Instance Method Details
#matches?(message) ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/logster/ignore_pattern.rb', line 13 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
25 26 27 |
# File 'lib/logster/ignore_pattern.rb', line 25 def to_s "<#Logster::IgnorePattern, msg_match: #{@msg_match.inspect}, env_match: #{@env_match.inspect}>" end |