Class: Filigree::SingleObjectPattern
- Inherits:
-
BasicPattern
- Object
- BasicPattern
- Filigree::SingleObjectPattern
- Extended by:
- AbstractClass
- Defined in:
- lib/filigree/match.rb
Overview
An abstract class that matches only a single object to a single pattern.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(pattern_elem) ⇒ SingleObjectPattern
constructor
Create a new pattern with a single element.
-
#match?(object, env) ⇒ Boolean
Testing the pattern only involves testing the single pattern element.
Methods included from AbstractClass
abstract_method, extended, install_icvars, new
Methods inherited from BasicPattern
Constructor Details
#initialize(pattern_elem) ⇒ SingleObjectPattern
Create a new pattern with a single element.
323 324 325 |
# File 'lib/filigree/match.rb', line 323 def initialize(pattern_elem) @pattern_elem = pattern_elem end |
Instance Method Details
#match?(object, env) ⇒ Boolean
Testing the pattern only involves testing the single pattern element.
334 335 336 |
# File 'lib/filigree/match.rb', line 334 def match?(object, env) match_pattern_element(@pattern_elem, object, env) end |