2009-03-06 18:27:40 +00:00
|
|
|
<% d = @doc_instance %>
|
|
|
|
|
2009-03-20 10:49:47 +00:00
|
|
|
<% @title = "#{d.full_name} #{d.type}" %>
|
2009-03-06 18:27:40 +00:00
|
|
|
|
|
|
|
<%= include "partials/breadcrumbs", :object => d %>
|
|
|
|
|
|
|
|
<h2 class="page-title <%= class_names_for(d) %>">
|
|
|
|
<span class="type"><%= d.type %> </span><%= d.full_name %>
|
|
|
|
</h2>
|
|
|
|
|
|
|
|
<% # Does it have a description? %>
|
|
|
|
|
2009-03-07 21:45:22 +00:00
|
|
|
<% if d.description && !d.description.empty? %>
|
2009-03-06 18:27:40 +00:00
|
|
|
<div class="section section-description">
|
|
|
|
|
|
|
|
<div class="section-title">
|
|
|
|
<h3>Description</h3>
|
|
|
|
</div> <!-- .section-title -->
|
|
|
|
|
|
|
|
<div class="section-content">
|
|
|
|
<%= htmlize(d.description) %>
|
|
|
|
</div> <!-- .section-content -->
|
|
|
|
|
|
|
|
</div> <!--.section -->
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% # Is it a CLASS? %>
|
|
|
|
<% if @doc_instance.is_a?(Documentation::Klass) %>
|
|
|
|
|
|
|
|
<% if @doc_instance.superklass %>
|
|
|
|
<div class="section section-superclass">
|
|
|
|
<div class="section-title">
|
|
|
|
<h3>Superclass</h3>
|
|
|
|
</div> <!-- .section-title -->
|
|
|
|
|
|
|
|
<div class="section-content">
|
|
|
|
<p><%= auto_link_code(d.superklass, false) %></p>
|
|
|
|
</div> <!-- .section-content -->
|
|
|
|
</div> <!-- .section -->
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% unless @doc_instance.subklasses.empty? %>
|
|
|
|
<div class="section section-subclasses">
|
|
|
|
<div class="section-title">
|
|
|
|
<h3>Subclasses</h3>
|
|
|
|
</div> <!-- .section-title -->
|
|
|
|
|
|
|
|
<div class="section-content">
|
|
|
|
<p><%= d.subklasses.map { |s| auto_link_code(s, false) }.join(', ') %></p>
|
|
|
|
</div> <!-- .section-content -->
|
|
|
|
</div> <!-- .section -->
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% # Does it have MIXINS? %>
|
|
|
|
<% unless @doc_instance.mixins.empty? %>
|
|
|
|
<div class="section section-mixins">
|
|
|
|
<div class="section-title">
|
|
|
|
<h3>Includes</h3>
|
|
|
|
</div> <!-- .section-title -->
|
|
|
|
|
|
|
|
<div class="section-content">
|
|
|
|
<p><%= d.mixins.map { |m| auto_link_code(m, false) }.join(', ') %></p>
|
|
|
|
</div> <!-- .section-content -->
|
|
|
|
</div> <!-- .section -->
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% # Are there related utilities? %>
|
|
|
|
<% unless @doc_instance.related_utilities.empty? %>
|
|
|
|
<div class="section section-utilities">
|
|
|
|
<div class="section-title">
|
|
|
|
<h3>Related utilities</h3>
|
|
|
|
</div> <!-- .section-title -->
|
|
|
|
|
|
|
|
<div class="section-content">
|
|
|
|
<p><%= d.related_utilities.map { |u| auto_link_code(u, false) }.join(', ') %></p>
|
|
|
|
</div> <!-- .section-content -->
|
|
|
|
</div> <!-- .section -->
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% # List its methods. %>
|
|
|
|
<% unless d.all_methods.empty? && d.mixins.empty? %>
|
|
|
|
<div class="section section-method-list">
|
|
|
|
<div class="section-title">
|
|
|
|
<h3>Methods</h3>
|
|
|
|
</div> <!-- .section-title -->
|
|
|
|
|
|
|
|
<div class="section-content">
|
|
|
|
<ul class="method-list">
|
|
|
|
<% d.all_methods.each do |method| %>
|
|
|
|
<li><%= auto_link_code(method, true, :class => class_names_for(method)) %></li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
|
2009-08-22 01:56:41 +00:00
|
|
|
<% unless @doc_instance.mixins.compact.empty? %>
|
2009-03-06 18:27:40 +00:00
|
|
|
<% d.mixins.each do |mixin| %>
|
|
|
|
<h4 class="inherited">Inherited from <%= auto_link(mixin) %></h4>
|
|
|
|
<ul class="method-list">
|
|
|
|
<% mixin.all_methods.each do |method| %>
|
|
|
|
<li><%= auto_link_code(method, true, :class => class_names_for(method)) %></li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
</div> <!-- .section-content -->
|
|
|
|
|
|
|
|
</div> <!-- .section -->
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if d.is_a?(Documentation::Klass) && d.constructor %>
|
|
|
|
<div class="section section-constructor">
|
|
|
|
<div class="section-title">
|
|
|
|
<h3>Constructor</h3>
|
|
|
|
</div> <!-- .section-title -->
|
|
|
|
|
|
|
|
<div class="section-content">
|
|
|
|
<pre id="<%= dom_id(d.constructor) %>" class="syntax"><code><%= d.constructor.ebnf_expressions.join("\n").strip %></code></pre>
|
2009-03-20 10:49:47 +00:00
|
|
|
<% unless d.constructor.arguments.empty? %>
|
|
|
|
<ul class="argument-list">
|
|
|
|
<% d.constructor.arguments.each do |arg| %>
|
|
|
|
<li>
|
|
|
|
<code><%= arg.name %></code>
|
|
|
|
<% unless arg.types.empty? %>
|
|
|
|
(<%= arg.types.map { |t| auto_link_code(t, false) }.join(' | ') %>)
|
|
|
|
<% end %>
|
|
|
|
<%= ' – ' + inline_htmlize(arg.description) unless arg.description.empty? %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul> <!-- .argument-list -->
|
|
|
|
<% end %>
|
|
|
|
|
2009-03-06 18:27:40 +00:00
|
|
|
|
|
|
|
<p><%= htmlize(d.constructor.description) %></p>
|
|
|
|
|
|
|
|
</div> <!-- .section-content -->
|
|
|
|
|
|
|
|
</div> <!-- .section -->
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
<%
|
|
|
|
types = {
|
|
|
|
:constants => "Constants",
|
|
|
|
:klass_methods => "Class methods",
|
|
|
|
:klass_properties => "Class properties",
|
|
|
|
:instance_methods => "Instance methods",
|
|
|
|
:instance_properties => "Instance properties"
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
|
|
|
|
<% types.each do |method, title| %>
|
|
|
|
<% methods = d.send(method) %>
|
|
|
|
<% unless methods.empty? %>
|
|
|
|
<div class="section section-<%= method.to_s %>">
|
|
|
|
|
|
|
|
<div class="section-title">
|
|
|
|
<h3><%= title %></h3>
|
|
|
|
</div> <!-- .section-title -->
|
|
|
|
|
|
|
|
<div class="section-content">
|
|
|
|
<ul class="method-details-list">
|
|
|
|
<%= include "partials/short_description", :collection => methods %>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div> <!-- .section-content -->
|
|
|
|
</div> <!-- .section -->
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|