Class: Rucoa::Nodes::ConstNode
- Inherits:
-
Base
- Object
- Parser::AST::Node
- Base
- Rucoa::Nodes::ConstNode
show all
- Defined in:
- lib/rucoa/nodes/const_node.rb
Instance Method Summary
collapse
Methods inherited from Base
#ancestors, #child_nodes, #descendant_nodes, #each_ancestor, #each_child_node, #each_descendant_node, #include_position?, #initialize, #namespace, #next_sibling_nodes, #parent, #parent=, #previous_sibling_nodes, #updated
Instance Method Details
#chained_name ⇒ String
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/rucoa/nodes/const_node.rb', line 28
def chained_name
case receiver
when Nodes::CbaseNode
[
'',
name
].join('::')
when Nodes::ConstNode
[
receiver.chained_name,
name
].join('::')
else
name
end
end
|
#module_nesting ⇒ Array<String>
64
65
66
|
# File 'lib/rucoa/nodes/const_node.rb', line 64
def module_nesting
each_ancestor(:class, :module).map(&:qualified_name)
end
|
#name ⇒ String
90
91
92
|
# File 'lib/rucoa/nodes/const_node.rb', line 90
def name
children[1].to_s
end
|