/
type.html
96 lines (82 loc) · 3.07 KB
/
type.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
<%= HeadTemplate.new(type, canonical_base_url) %>
<meta id="repository-name" content="<%= type.repository_name %>">
<title><%= type.full_name %> - <%= type.repository_name %></title>
</head>
<body>
<%= SidebarTemplate.new(type.repository_name, types, type) %>
<div class="main-content">
<h1 class="type-name">
<% if type.program? %>
<%= type.full_name %>
<% else %>
<span class="kind"><%= type.abstract? ? "abstract " : ""%><%= type.kind %></span> <%= type.full_name %>
<% end %>
</h1>
<% if type.superclass %>
<%= type.superclass_hierarchy %>
<% end %>
<% if doc = type.formatted_doc %>
<h2>Overview</h2>
<%= doc %>
<% end %>
<% if type.alias? %>
<h2>Alias Definition</h2>
<code><%= type.formatted_alias_definition %></code>
<% end %>
<%= OtherTypesTemplate.new("Included Modules", type, type.included_modules) %>
<%= OtherTypesTemplate.new("Extended Modules", type, type.extended_modules) %>
<%= OtherTypesTemplate.new("Direct Known Subclasses", type, type.subclasses) %>
<%= OtherTypesTemplate.new("Direct including types", type, type.including_types) %>
<% if locations = type.locations %>
<h2>Defined in:</h2>
<% locations.each do |location| %>
<% if url = location.url %>
<a href="<%= url %>#L<%= location.line_number %>" target="_blank">
<%= location.filename %><% if location.show_line_number %>:<%= location.line_number %><% end %>
</a>
<% else %>
<%= location.filename %><% if location.show_line_number %>:<%= location.line_number %><% end %>
<% end %>
<br/>
<% end %>
<% end %>
<% unless type.constants.empty? %>
<% if type.enum? %>
<h2>Enum Members</h2>
<% else %>
<h2>Constant Summary</h2>
<% end %>
<dl>
<% type.constants.each do |const| %>
<dt class="entry-const" id="<%= const.id %>">
<strong><%= const.name %></strong> = <code><%= const.formatted_value %></code>
</dt>
<% if doc = const.formatted_doc %>
<dd class="entry-const-doc">
<%= doc %>
</dd>
<% end %>
<% end %>
</dl>
<% end %>
<%= MethodSummaryTemplate.new("Constructors", type.constructors) %>
<%= MethodSummaryTemplate.new(type.program? ? "Method Summary" : "Class Method Summary", type.class_methods) %>
<%= MethodSummaryTemplate.new("Instance Method Summary", type.instance_methods) %>
<%= MethodSummaryTemplate.new("Macro Summary", type.macros) %>
<div class="methods-inherited">
<% type.ancestors.each do |ancestor| %>
<%= MethodsInheritedTemplate.new(type, ancestor, ancestor.instance_methods, "Instance") %>
<%= MethodsInheritedTemplate.new(type, ancestor, ancestor.constructors, "Constructor") %>
<%= MethodsInheritedTemplate.new(type, ancestor, ancestor.class_methods, "Class") %>
<% end %>
</div>
<%= MethodDetailTemplate.new("Constructor Detail", type.constructors) %>
<%= MethodDetailTemplate.new(type.program? ? "Method Detail" : "Class Method Detail", type.class_methods) %>
<%= MethodDetailTemplate.new("Instance Method Detail", type.instance_methods) %>
<%= MethodDetailTemplate.new("Macro Detail", type.macros) %>
</div>
</body>
</html>