Class: Filigree::LiteralPattern
- Inherits:
-
SingleObjectPattern
- Object
- BasicPattern
- SingleObjectPattern
- Filigree::LiteralPattern
- Defined in:
- lib/filigree/match.rb
Overview
A pattern that forces an equality comparison
Instance Attribute Summary
Attributes inherited from SingleObjectPattern
Instance Method Summary collapse
-
#match?(object, _) ⇒ Boolean
Test the object for equality to the pattern element.
- #weight ⇒ Object
Methods inherited from SingleObjectPattern
Methods included from AbstractClass
#abstract_method, extended, #install_icvars, #new
Methods inherited from BasicPattern
Constructor Details
This class inherits a constructor from Filigree::SingleObjectPattern
Instance Method Details
#match?(object, _) ⇒ Boolean
Test the object for equality to the pattern element.
392 393 394 |
# File 'lib/filigree/match.rb', line 392 def match?(object, _) object == @pattern_elem end |
#weight ⇒ Object
396 397 398 |
# File 'lib/filigree/match.rb', line 396 def weight 0 end |