MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / get_tree_body

Function get_tree_body

code2flow/ruby.py:151–165  ·  view source on GitHub ↗

Depending on the type of element, get the body of that element :param tree_el ast: :rtype: list[tree_el]

(tree_el)

Source from the content-addressed store, hash-verified

149
150
151def get_tree_body(tree_el):
152 """
153 Depending on the type of element, get the body of that element
154
155 :param tree_el ast:
156 :rtype: list[tree_el]
157 """
158
159 if tree_el[0] == 'module':
160 body_struct = tree_el[2]
161 elif tree_el[0] == 'defs':
162 body_struct = tree_el[4]
163 else:
164 body_struct = tree_el[3]
165 return as_lines(body_struct)
166
167
168def get_inherits(tree, body_tree):

Callers 2

make_nodesMethod · 0.85
make_class_groupMethod · 0.85

Calls 1

as_linesFunction · 0.85

Tested by

no test coverage detected