Class: Bracken::Logfile::Filter

Inherits:
Struct
  • Object
show all
Defined in:
lib/bracken/logfile/filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#patternObject

Returns the value of attribute pattern

Returns:

  • (Object)

    the current value of pattern



4
5
6
# File 'lib/bracken/logfile/filter.rb', line 4

def pattern
  @pattern
end

#serviceObject

Returns the value of attribute service

Returns:

  • (Object)

    the current value of service



4
5
6
# File 'lib/bracken/logfile/filter.rb', line 4

def service
  @service
end

Instance Method Details

#match?(line) ⇒ Boolean

FIXME this is heinous

Returns:

  • (Boolean)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/bracken/logfile/filter.rb', line 6

def match?(line)
  if line.include?(service)
    if pattern
      if line.match(pattern)
        true
      else
        false
      end
    else
      true
    end
  else
    false
  end
end