Class: Glark::PatternFilter
- Inherits:
-
Filter
- Object
- Filter
- Glark::PatternFilter
show all
- Includes:
- Logue::Loggable
- Defined in:
- lib/glark/input/filter/filter.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Filter
#match?
Constructor Details
15
16
17
|
# File 'lib/glark/input/filter/filter.rb', line 15
def initialize pattern
@pattern = pattern
end
|
Instance Attribute Details
#pattern ⇒ Object
Returns the value of attribute pattern.
13
14
15
|
# File 'lib/glark/input/filter/filter.rb', line 13
def pattern
@pattern
end
|
Instance Method Details
#pattern_match?(str) ⇒ Boolean
19
20
21
22
23
24
25
|
# File 'lib/glark/input/filter/filter.rb', line 19
def pattern_match? str
if @pattern.kind_of? String
@pattern == str
else
@pattern.match str
end
end
|
#to_s ⇒ Object
27
28
29
|
# File 'lib/glark/input/filter/filter.rb', line 27
def to_s
@pattern.to_s
end
|