Class: Rucoa::Nodes::DefNode
Instance Method Summary
collapse
#ensure, #rescue
#body, #body_children
Methods inherited from Base
#ancestors, #child_nodes, #descendant_nodes, #each_ancestor, #each_child_node, #each_descendant_node, #include_position?, #initialize, #module_nesting, #namespace, #next_sibling_nodes, #parent, #parent=, #previous_sibling_nodes, #updated
Instance Method Details
19
20
21
|
# File 'lib/rucoa/nodes/def_node.rb', line 19
def arguments
children[-2]
end
|
#method_marker ⇒ String
24
25
26
27
28
29
30
|
# File 'lib/rucoa/nodes/def_node.rb', line 24
def method_marker
if singleton?
'.'
else
'#'
end
end
|
#name ⇒ String
51
52
53
|
# File 'lib/rucoa/nodes/def_node.rb', line 51
def name
children[-3].to_s
end
|
#qualified_name ⇒ String
74
75
76
77
78
79
80
|
# File 'lib/rucoa/nodes/def_node.rb', line 74
def qualified_name
[
namespace,
method_marker,
name
].join
end
|
#singleton? ⇒ Boolean
83
84
85
|
# File 'lib/rucoa/nodes/def_node.rb', line 83
def singleton?
type == :defs || each_ancestor(:sclass).any?
end
|