Class: PatternMatch::PatternVariable
- Inherits:
-
PatternElement
- Object
- Pattern
- PatternElement
- PatternMatch::PatternVariable
- Defined in:
- lib/egison/core.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Pattern
Instance Method Summary collapse
-
#initialize(name) ⇒ PatternVariable
constructor
A new instance of PatternVariable.
- #match(tgt, bindings) ⇒ Object
Methods inherited from Pattern
Constructor Details
#initialize(name) ⇒ PatternVariable
Returns a new instance of PatternVariable.
142 143 144 145 |
# File 'lib/egison/core.rb', line 142 def initialize(name) super() @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
140 141 142 |
# File 'lib/egison/core.rb', line 140 def name @name end |
Instance Method Details
#match(tgt, bindings) ⇒ Object
147 148 149 |
# File 'lib/egison/core.rb', line 147 def match(tgt, bindings) [[[], [[name, tgt]]]] end |