Skip to content

Commit 6852567

Browse files
Split list of class and instance methods in two (#1206)
Looking for a method is easier because eyes don't have to skip dashes or double colon.
1 parent 50dda13 commit 6852567

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
<%- unless klass.method_list.empty? then %>
2-
<!-- Method Quickref -->
3-
<div id="method-list-section" class="nav-section">
4-
<h3>Methods</h3>
1+
<% if (class_methods = klass.class_method_list.sort).any? %>
2+
<div class="nav-section">
3+
<h3>Class Methods</h3>
4+
<ul class="link-list" role="directory">
5+
<%- class_methods.each do |meth| -%>
6+
<li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
7+
<%- end -%>
8+
</ul>
9+
</div>
10+
<% end %>
511

6-
<ul class="link-list" role="directory">
7-
<%- klass.each_method do |meth| -%>
8-
<li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name -%></a>
9-
<%- end -%>
10-
</ul>
11-
</div>
12-
<%- end -%>
12+
<% if (instance_methods = klass.instance_methods.sort).any? %>
13+
<div class="nav-section">
14+
<h3>Instance Methods</h3>
15+
<ul class="link-list" role="directory">
16+
<%- instance_methods.each do |meth| -%>
17+
<li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
18+
<%- end -%>
19+
</ul>
20+
</div>
21+
<% end %>

0 commit comments

Comments
 (0)