<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja-JP">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=<%=h charset() %>">
  <meta http-equiv="Content-Language" content="ja-JP">
  <link rel="stylesheet" type="text/css" href="<%=h css_url() %>">
  <title><%=h @entry.type %> <%=h @entry.name %></title>
</head>
<body>

<p>
Ruby <%=h ruby_version() %>
&gt; <%= document_link('index', 'Home') %>
&gt; <a href="<%= library_index_url() %>">All Libraries</a>
&gt; library <%= library_link(@entry.library.name) %>
&gt; <%=h @entry.type %> <%=h @entry.name %>
</p>
<%= search_form() %>

<%
    headline_init
%>
<%= headline("#{@entry.type} #{@entry.name}" + @entry.ancestors[1..@alevel].map{|c| " + #{c.name}" }.join) %>
<p>
<%
    myself, *supers = @entry.ancestors
    n = 0
%>
ancestors: <%= escape_html(myself.name) %>
<%  supers.each do |c| %>
      <%= @conf[:tochm_mode] ? "&lt;" : a_href("?a=#{n}", "<")  %> <%= class_link(c.name) %>
      <%n += 1 %>
<%  end %>

<% unless @entry.extended.empty? %>
<br>extend: <%= @entry.extended.map {|c| class_link(c.name) }.join(', ') %>
<% end %>
</p>
<%
    headline_push
%>
<%= headline("Abstract") %>
<%= compile_rd(@entry.source) %>

<%
    ents =  @entry.partitioned_entries(@alevel)
    [['Singleton Methods',         ents.singleton_methods          ],
     ['Instance Methods',          ents.instance_methods           ],
     ['Private Singleton Methods', ents.private_singleton_methods  ],
     ['Private Instance Methods',  ents.private_instance_methods   ],
     ['Module Functions',          ents.module_functions           ],
     ['Constants',                 ents.constants                  ],
     ['Special Variables',         ents.special_variables          ]]\
    .each do |label, entries|
      unless entries.empty? %>
<%=     headline(label) %>
<table class="entries">
<tr><th>signature</th><th colspan="2">description</th></tr>
<%
        headline_push
        entries.each do |m|
          foreach_method_chunk(m.source) do |sigs, src| %>
<tr>
<td class="signature"><%=
              sigs.map {|sig|
              name, params = sig.split(/(?=\(|\z|\s*[-{])/, 2)
              method_link(m.spec_string, name) + escape_html(params)
            }.join("<br>") %></td>
<%          if m.redefined? %>
<td class="description"><%= compile_rd(src) %></td>
<td class="library"><%= library_link(m.library.name) %></td>
<%          elsif @entry.name != m.klass.name %>
<td class="description"><%= compile_rd(src) %></td>
<td class="library"><%= class_link(m.klass.name) %></td>
<%          else %>
<td class="description" colspan="2"><%= compile_rd(src) %></td>
<%          end %>
</tr>
<%
          end
        end
        headline_pop
%>
</table>
<%
      end
    end
%>

<%  specs = @entry.inherited_method_specs.sort
    unless specs.empty?  %>
<%= headline('Inherited Methods') %>
<p><code>
<%    specs.each do |s| %>
<%=     method_link(s.to_s, (s.type == '#' ? s.method : s.type + s.method)) %>
<%    end %>
</code></p>
<%  end %>

<%
    [['Added Methods',          ents.added]]\
    .each do |label, entries|
      unless entries.empty?  %>
<%=     headline(label) %>
<table class="entries">
<tr><th>signature</th><th>description</th><th>library</th></tr>
<%
        headline_push
        entries.each do |m|
          foreach_method_chunk(m.source) do |sigs, src| %>
<tr>
<td class="signature"><%=
            sigs.map {|sig|
              name, params = sig.split(/(?=\(|\z|\s*[-{])/, 2)
              method_link(m.spec_string, name) + escape_html(params)
            }.join("<br>") %></td>
<td class="description"><%= compile_rd(src) %></td>
<td class="library"><%= library_link(m.library.name) %></td>
</tr>
<%
          end
        end
        headline_pop
%>
</table>
<%
      end
    end
    headline_pop
%>

</body>
</html>
