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.
260 261 262 263 |
# File 'lib/egison/core.rb', line 260 def initialize(name) super() @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
258 259 260 |
# File 'lib/egison/core.rb', line 258 def name @name end |
Instance Method Details
#match(tgt, bindings) ⇒ Object
265 266 267 |
# File 'lib/egison/core.rb', line 265 def match(tgt, bindings) [[[], [[name, tgt]]]] end |