Class: PatternMatch::PatternVariable

Inherits:
PatternElement show all
Defined in:
lib/egison/core.rb

Instance Attribute Summary collapse

Attributes inherited from Pattern

#quantified

Instance Method Summary collapse

Methods inherited from Pattern

#match_stream, #to_a

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

#nameObject (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