<%############ Class/Module title #############%> <% if classmod.module? %>

Module <%= classmod.full_name %>

<% else %>

Class <%= classmod.full_name %>

<% if classmod.superclass.kind_of?(String) %> Parent: <%= classmod.superclass %> <% else %> Parent: <%= classmod.superclass.full_name %> <% end %>

<% end %> <%############ Method overview #############%> <% unless classmod.method_list.empty? %>

Method List

<% end %> <%############ Description #############%> <%= classmod.description %>
<%############ Includes #############%> <% unless classmod.includes.empty? %>

Includes

<% end %> <%############ Constants #############%> <% unless classmod.constants.empty? %>

Constants

<% classmod.constants.each do |const| %> <% abbrev_value = const.value.chars.count > 20 ? const.value.chars.first(20).join + "..." : const.value %> <% end %>
NameValueDescription
<%= const.name %><%= abbrev_value %><%= const.description %>
<% end %> <%############ Attributes #############%> <% unless classmod.attributes.empty? %>

Attributes

<% end %> <%############ Methods #############%> <% methods_by_type = classmod.methods_by_type %> <% ["class", "instance"].each do |type| %> <%# Yes, these are strings... %> <% [:public, :protected, :private].each do |visibility| %> <%# ...and these symbols. %> <%# Where there are no methods defined, there is no need for docs. %> <% next if methods_by_type[type].empty? %> <% next if methods_by_type[type][visibility].empty? %>

"><%= "#{visibility.capitalize} #{type.capitalize} Methods" %>

<% methods_by_type[type][visibility].sort_by(&:name).each do |method| %>
" id="<%= method.aref %>">
<%= method.arglists.gsub("\n", "
") %>
<%= method.description %> <%# Source link and display %>

[Show source]

<% end %> <% end %> <% end %>