Class: PatternMatch::AndPattern
- Inherits:
-
PatternElement
- Object
- Pattern
- PatternElement
- PatternMatch::AndPattern
- Defined in:
- lib/egison/core.rb
Instance Attribute Summary collapse
-
#pats ⇒ Object
readonly
Returns the value of attribute pats.
Attributes inherited from Pattern
Instance Method Summary collapse
-
#initialize(*subpatterns) ⇒ AndPattern
constructor
A new instance of AndPattern.
- #match(tgt, bindings) ⇒ Object
Methods inherited from Pattern
Constructor Details
#initialize(*subpatterns) ⇒ AndPattern
Returns a new instance of AndPattern.
237 238 239 240 |
# File 'lib/egison/core.rb', line 237 def initialize(*subpatterns) super() @pats = subpatterns end |
Instance Attribute Details
#pats ⇒ Object (readonly)
Returns the value of attribute pats.
235 236 237 |
# File 'lib/egison/core.rb', line 235 def pats @pats end |
Instance Method Details
#match(tgt, bindings) ⇒ Object
242 243 244 |
# File 'lib/egison/core.rb', line 242 def match(tgt, bindings) [[@pats.map { |pat| [pat, tgt] }, []]] end |