31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/rubyspy.rb', line 31
def p_classtree_sub(c)
group = c.public_instance_methods(false).sort.partition { |m| m =~ /\w/ }
array = group.flatten
operator_start_index = group[0].size
limit = ALPHABET_DISP_NUM
print((array.size > limit) ? "| " : "↓ ")
counter = 0
array.each_with_index do |v, index|
if (index == operator_start_index)
limit = OPERATOR_DISP_NUM
counter = 0
puts
print((array.size - index > limit) ? "| " : "↓ ")
end
if (counter >= limit)
counter = 0
puts
print((array.size - index > limit) ? "| " : "↓ ")
end
print v + ", "
counter += 1
end
puts
end
|