Class: Filter::Matchers::Symbol
- Defined in:
- lib/filter/matchers/symbol.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #===(other) ⇒ Object
-
#initialize(pattern) ⇒ Symbol
constructor
A new instance of Symbol.
Methods inherited from Base
Constructor Details
#initialize(pattern) ⇒ Symbol
Returns a new instance of Symbol.
4 5 6 |
# File 'lib/filter/matchers/symbol.rb', line 4 def initialize(pattern) @pattern = pattern.to_proc end |
Instance Method Details
#===(other) ⇒ Object
8 9 10 |
# File 'lib/filter/matchers/symbol.rb', line 8 def ===(other) pattern.call(other) end |