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.



235
236
237
238
# File 'lib/egison/core.rb', line 235

def initialize(name)
  super()
  @name = name
end

Instance Attribute Details

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