@@ -36,16 +36,24 @@ def generate_objects
36
36
37
37
@documentation . each do |doc |
38
38
next if skip_namespace? doc . full_name
39
- methods = [ ]
39
+
40
+ methods = { "class" => [ ] , "instance" => [ ] }
40
41
41
42
doc . method_list . each do |method_doc |
42
- next if methods . find { |m | m [ :name ] == method_doc . name }
43
+ method_name = method_doc . name
44
+
45
+ if methods . any? do |_type , set |
46
+ set . find { |m | m [ :name ] == method_name }
47
+ end
48
+ next
49
+ end
43
50
44
- methods << {
45
- name : method_doc . name ,
51
+ method_type = method_doc . type
52
+ methods [ method_type ] << {
53
+ name : method_name ,
46
54
description : clean_description ( method_doc . description ) ,
47
55
object_constant : doc . full_name ,
48
- method_type : " #{ method_doc . type } _method" ,
56
+ method_type : method_type ,
49
57
source_location : "#{ @release . version } :#{ method_path ( method_doc ) } :#{ method_doc . line } " ,
50
58
call_sequence : method_doc . call_seq ? method_doc . call_seq . strip . split ( "\n " ) . map { |s | s . gsub "->" , "→" } : "" ,
51
59
metadata : {
@@ -66,7 +74,8 @@ def generate_objects
66
74
objects << RubyObject . new (
67
75
name : doc . name ,
68
76
description : clean_description ( doc . description ) ,
69
- methods : methods ,
77
+ class_methods : methods [ "class" ] ,
78
+ instance_methods : methods [ "instance" ] ,
70
79
constant : doc . full_name ,
71
80
object_type : "#{ doc . type } _object" ,
72
81
superclass : superclass ,
@@ -86,7 +95,8 @@ def index_object(object)
86
95
object_repository . save ( object )
87
96
search_repository . save ( object )
88
97
89
- object . ruby_methods . each { |m | search_repository . save m }
98
+ object . ruby_class_methods . each { |m | search_repository . save m }
99
+ object . ruby_instance_methods . each { |m | search_repository . save m }
90
100
end
91
101
92
102
def object_repository
0 commit comments