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.
390 391 392 |
# File 'lib/filigree/match.rb', line 390 def match?(object, _) object == @pattern_elem end |
#weight ⇒ Object
394 395 396 |
# File 'lib/filigree/match.rb', line 394 def weight 0 end |