Class: PatternMatch::PatternAnd
- Inherits:
-
PatternElement
- Object
- Pattern
- PatternElement
- PatternMatch::PatternAnd
- Defined in:
- lib/pattern-match/core.rb
Instance Attribute Summary
Attributes inherited from Pattern
Instance Method Summary collapse
Methods inherited from PatternElement
Methods inherited from Pattern
#!@, #&, #ancestors, #append, #directly_quantified?, #initialize, #inspect, #quantified?, #quantifier?, #quasibinding, #root, #root?, #to_a, #vars, #|
Methods included from PatternMatch::Pattern::Backtrackable
Constructor Details
This class inherits a constructor from PatternMatch::Pattern
Instance Method Details
#match(vals) ⇒ Object
401 402 403 404 405 |
# File 'lib/pattern-match/core.rb', line 401 def match(vals) super do |val| subpatterns.all? {|i| i.match([val]) } end end |
#validate ⇒ Object
407 408 409 410 |
# File 'lib/pattern-match/core.rb', line 407 def validate super raise MalformedPatternError if subpatterns.empty? end |