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

#to_a

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

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