Class: Filter::Matchers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/filter/matchers/base.rb

Direct Known Subclasses

Array, Boolean, Class, Hash, Nil, Symbol

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern) ⇒ Base

Returns a new instance of Base.



6
7
8
# File 'lib/filter/matchers/base.rb', line 6

def initialize(pattern)
  @pattern = pattern
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



4
5
6
# File 'lib/filter/matchers/base.rb', line 4

def pattern
  @pattern
end

Instance Method Details

#===(other) ⇒ Object



10
11
12
# File 'lib/filter/matchers/base.rb', line 10

def ===(other)
  pattern === other
end

#and(other) ⇒ Object Also known as: &



14
15
16
# File 'lib/filter/matchers/base.rb', line 14

def and(other)
  Filter.and(self, other)
end

#or(other) ⇒ Object Also known as: |



19
20
21
# File 'lib/filter/matchers/base.rb', line 19

def or(other)
  Filter.or(self, other)
end