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.
235 236 237 238 |
# File 'lib/egison/core.rb', line 235 def initialize(name) super() @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
233 234 235 |
# File 'lib/egison/core.rb', line 233 def name @name end |
Instance Method Details
#match(tgt, bindings) ⇒ Object
240 241 242 |
# File 'lib/egison/core.rb', line 240 def match(tgt, bindings) [[[], [[name, tgt]]]] end |