Class: Metamorpher::Terms::Term
Instance Attribute Summary collapse
Instance Method Summary
collapse
#substitute
#replace
#match
Methods included from Visitable
#accept
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
12
13
14
|
# File 'lib/metamorpher/terms/term.rb', line 12
def parent
@parent
end
|
Instance Method Details
#alternatives ⇒ Object
23
24
25
|
# File 'lib/metamorpher/terms/term.rb', line 23
def alternatives
[self]
end
|
#inspect ⇒ Object
19
20
21
|
# File 'lib/metamorpher/terms/term.rb', line 19
def inspect
name
end
|
#path ⇒ Object
27
28
29
30
31
32
33
|
# File 'lib/metamorpher/terms/term.rb', line 27
def path
if parent
parent.path << parent.children.index { |c| c.equal?(self) }
else
[]
end
end
|
#with_younger_siblings ⇒ Object
35
36
37
38
39
40
41
|
# File 'lib/metamorpher/terms/term.rb', line 35
def with_younger_siblings
if parent
parent.children_younger_than_or_equal_to(self)
else
[self]
end
end
|