aboutsummaryrefslogtreecommitdiff
path: root/doc/Zero/Renderer.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/Zero/Renderer.html')
-rw-r--r--doc/Zero/Renderer.html463
1 files changed, 325 insertions, 138 deletions
diff --git a/doc/Zero/Renderer.html b/doc/Zero/Renderer.html
index 4ce1cee..0ff7fb7 100644
--- a/doc/Zero/Renderer.html
+++ b/doc/Zero/Renderer.html
@@ -102,22 +102,22 @@
<h2>Overview</h2><div class="docstring">
<div class="discussion">
-<p>This class helps with rendering of content.</p>
+<p>the base renderer for getting render containers</p>
-<p>The purpose of this class is to render templates. All variables pushed into
-the renderer should be already processed, so that the raw data can be used.</p>
+<p>This class handles templates and render coontainers, which can be used for
+the actual rendering.</p>
-<p>The workflow of this class is like the following.</p>
-<ul><li>
-<p>setup the type mapping</p>
-</li><li>
-<p>create a new instance of the class to prepare rendering</p>
-</li><li>
-<p>call #render to process the template</p>
-</li></ul>
+<p>To use this renderer you have to give it a template path and optionally a
+map of shorthand type descriptions to fully types. This will then be used
+to extend the internal map of templates to possible formats in a way, that
+you will be able to answer xhtml and html requests with the same template.</p>
-<p>The call to #render will return the String representation of the template
-with all data given.</p>
+<p>When the object is initialized and you are sure, everything is loaded, call
+#read_template_path! and the template tree will be built. Without this
+step, you will probably don't get any output.</p>
+
+<p>After the setup, the renderer can be used to build render containers, which
+then can be used to actually render something.</p>
</div>
@@ -129,21 +129,13 @@ with all data given.</p>
-
-
-
-
- <h2>
- Class Method Summary
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
- </h2>
-
- <ul class="summary">
-
- <li class="public ">
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
+ <ul class="summary">
+
+ <li class="public ">
<span class="summary_signature">
- <a href="#template_path%3D-class_method" title="template_path= (class method)">+ (Object) <strong>template_path=</strong>(path) </a>
+ <a href="#template_path-instance_method" title="#template_path (instance method)">- (String) <strong>template_path</strong> </a>
@@ -151,6 +143,11 @@ with all data given.</p>
+
+ <span class="note title readonly">readonly</span>
+
+
+
@@ -158,16 +155,16 @@ with all data given.</p>
<span class="summary_desc"><div class='inline'>
-<p>set a base path for template search.</p>
+<p>get the path to the templates.</p>
</div></span>
</li>
-
- <li class="public ">
+
+ <li class="public ">
<span class="summary_signature">
- <a href="#type_map-class_method" title="type_map (class method)">+ (Hash) <strong>type_map</strong> </a>
+ <a href="#templates-instance_method" title="#templates (instance method)">- (Hash) <strong>templates</strong> </a>
@@ -175,23 +172,28 @@ with all data given.</p>
+
+ <span class="note title readonly">readonly</span>
+
+
+ <span class="private note title">private</span>
<span class="summary_desc"><div class='inline'>
-<p>returns the type map.</p>
+<p>get the tree of templates.</p>
</div></span>
</li>
-
- <li class="public ">
+
+ <li class="public ">
<span class="summary_signature">
- <a href="#type_map%3D-class_method" title="type_map= (class method)">+ (Object) <strong>type_map=</strong>(map) </a>
+ <a href="#type_map-instance_method" title="#type_map (instance method)">- (Hash) <strong>type_map</strong> </a>
@@ -199,6 +201,11 @@ with all data given.</p>
+
+ <span class="note title readonly">readonly</span>
+
+
+
@@ -206,13 +213,17 @@ with all data given.</p>
<span class="summary_desc"><div class='inline'>
-<p>save a mapping hash for the type.</p>
+<p>returns the hash of type conversions.</p>
</div></span>
</li>
-
- </ul>
+
+ </ul>
+
+
+
+
<h2>
Instance Method Summary
@@ -224,7 +235,7 @@ with all data given.</p>
<li class="public ">
<span class="summary_signature">
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (Renderer) <strong>initialize</strong>(path, context, accept_types) </a>
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Renderer) <strong>initialize</strong>(template_path, type_map = {}) </a>
@@ -241,7 +252,7 @@ with all data given.</p>
<span class="summary_desc"><div class='inline'>
-<p>take the path and render the template within the context.</p>
+<p>initializes a new Renderer.</p>
</div></span>
</li>
@@ -250,7 +261,7 @@ with all data given.</p>
<li class="public ">
<span class="summary_signature">
- <a href="#render-instance_method" title="#render (instance method)">- (String) <strong>render</strong> </a>
+ <a href="#read_template_path%21-instance_method" title="#read_template_path! (instance method)">- (Self) <strong>read_template_path!</strong> </a>
@@ -265,7 +276,31 @@ with all data given.</p>
<span class="summary_desc"><div class='inline'>
-<p>render the template within the context.</p>
+<p>load the template tree.</p>
+</div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#render-instance_method" title="#render (instance method)">- (String) <strong>render</strong>(name, type, context) </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'>
+<p>render a template.</p>
</div></span>
</li>
@@ -280,7 +315,7 @@ with all data given.</p>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
- - (<tt><span class='object_link'><a href="" title="Zero::Renderer (class)">Renderer</a></span></tt>) <strong>initialize</strong>(path, context, accept_types)
+ - (<tt><span class='object_link'><a href="" title="Zero::Renderer (class)">Renderer</a></span></tt>) <strong>initialize</strong>(template_path, type_map = {})
@@ -289,18 +324,46 @@ with all data given.</p>
</h3><div class="docstring">
<div class="discussion">
-<p>take the path and render the template within the context</p>
+<p>initializes a new Renderer</p>
+
+<p>This method takes a path to the base template directory and a type map.
+This type map is used to extend the possible renderings for different
+types, which the clients sends.</p>
</div>
</div>
<div class="tags">
- <p class="tag_title">Parameters:</p>
+
+ <div class="examples">
+ <p class="tag_title">Examples:</p>
+
+
+ <p class="example_title"><div class='inline'>
+<p>create a simple renderer</p>
+</div></p>
+
+ <pre class="example code"><span class='rubyid_Renderer constant id'>Renderer</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='string val'>'app/templates'</span><span class='rparen token'>)</span>
+</pre>
+
+
+ <p class="example_title"><div class='inline'>
+<p>create a renderer with a small map</p>
+</div></p>
+
+ <pre class="example code"><span class='rubyid_Renderer constant id'>Renderer</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='string val'>'app'</span><span class='comma token'>,</span> <span class='lbrace token'>{</span>
+ <span class='string val'>'html'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>'text/html'</span><span class='comma token'>,</span> <span class='string val'>'application/html+xml'</span><span class='rbrack token'>]</span><span class='comma token'>,</span>
+ <span class='string val'>'json'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>'application/json'</span><span class='comma token'>,</span> <span class='string val'>'application/aweomse+json'</span><span class='rbrack token'>]</span>
+<span class='rbrace token'>}</span><span class='rparen token'>)</span>
+</pre>
+
+ </div>
+<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
- <span class='name'>path</span>
+ <span class='name'>template_path</span>
<span class='type'>(<tt>String</tt>)</span>
@@ -309,38 +372,29 @@ with all data given.</p>
&mdash;
<div class='inline'>
-<p>the relative path to the template</p>
+<p>a string to templates</p>
</div>
</li>
<li>
- <span class='name'>context</span>
+ <span class='name'>type_map</span>
- <span class='type'>(<tt>Object</tt>)</span>
+ <span class='type'>(<tt>Hash</tt>)</span>
+
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
&mdash;
<div class='inline'>
-<p>the object to process on</p>
+<p>a map of simple types to complex ones</p>
</div>
</li>
- <li>
-
- <span class='name'>accept_types</span>
-
-
- <span class='type'></span>
-
-
-
- </li>
-
</ul>
@@ -350,19 +404,17 @@ with all data given.</p>
<pre class="lines">
-49
-50
-51
-52
-53</pre>
+36
+37
+38
+39</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 49</span>
+ <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 36</span>
-<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_path identifier id'>path</span><span class='comma token'>,</span> <span class='rubyid_context identifier id'>context</span><span class='comma token'>,</span> <span class='rubyid_accept_types identifier id'>accept_types</span><span class='rparen token'>)</span>
- <span class='rubyid_accept_types identifier id'>accept_types</span> <span class='opasgn op'>||=</span> <span class='rubyid_Request constant id'>Request</span><span class='colon2 op'>::</span><span class='rubyid_Accept constant id'>Accept</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='string val'>'text/html'</span><span class='rparen token'>)</span>
- <span class='rubyid_@path ivar id'>@path</span> <span class='assign token'>=</span> <span class='rubyid_find_template identifier id'>find_template</span><span class='lparen token'>(</span><span class='rubyid_path identifier id'>path</span><span class='comma token'>,</span> <span class='rubyid_accept_types identifier id'>accept_types</span><span class='rparen token'>)</span>
- <span class='rubyid_@context ivar id'>@context</span> <span class='assign token'>=</span> <span class='rubyid_context identifier id'>context</span>
+<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_template_path identifier id'>template_path</span><span class='comma token'>,</span> <span class='rubyid_type_map identifier id'>type_map</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
+ <span class='rubyid_@template_path ivar id'>@template_path</span> <span class='assign token'>=</span> <span class='rubyid_template_path identifier id'>template_path</span> <span class='plus op'>+</span> <span class='string val'>'/'</span>
+ <span class='rubyid_@type_map ivar id'>@type_map</span> <span class='assign token'>=</span> <span class='rubyid_type_map identifier id'>type_map</span>
<span class='rubyid_end end kw'>end</span>
</pre>
</td>
@@ -372,15 +424,15 @@ with all data given.</p>
</div>
-
- <div id="class_method_details" class="method_details_list">
- <h2>Class Method Details</h2>
-
+ <div id="instance_attr_details" class="attr_details">
+ <h2>Instance Attribute Details</h2>
+
+ <span id=""></span>
<div class="method_details first">
- <h3 class="signature first" id="template_path=-class_method">
+ <h3 class="signature first" id="template_path-instance_method">
- + (<tt>Object</tt>) <strong>template_path=</strong>(path)
+ - (<tt>String</tt>) <strong>template_path</strong> <span class="extras">(readonly)</span>
@@ -389,19 +441,18 @@ with all data given.</p>
</h3><div class="docstring">
<div class="discussion">
-<p>set a base path for template search</p>
+<p>get the path to the templates</p>
</div>
</div>
<div class="tags">
- <p class="tag_title">Parameters:</p>
-<ul class="param">
+
+<p class="tag_title">Returns:</p>
+<ul class="return">
<li>
- <span class='name'>path</span>
-
<span class='type'>(<tt>String</tt>)</span>
@@ -409,29 +460,28 @@ with all data given.</p>
&mdash;
<div class='inline'>
-<p>the path to the template base dir</p>
+<p>the base template path</p>
</div>
</li>
</ul>
-
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
-20
-21
-22</pre>
+46
+47
+48</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 20</span>
+ <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 46</span>
-<span class='rubyid_def def kw'>def</span> <span class='rubyid_template_path= identifier id'>template_path=</span><span class='lparen token'>(</span><span class='rubyid_path identifier id'>path</span><span class='rparen token'>)</span>
- <span class='rubyid_@@path ivar id'>@@path</span> <span class='assign token'>=</span> <span class='rubyid_path identifier id'>path</span> <span class='plus op'>+</span> <span class='string val'>'/'</span>
+<span class='rubyid_def def kw'>def</span> <span class='rubyid_template_path identifier id'>template_path</span>
+ <span class='rubyid_@template_path ivar id'>@template_path</span>
<span class='rubyid_end end kw'>end</span>
</pre>
</td>
@@ -439,10 +489,12 @@ with all data given.</p>
</table>
</div>
+
+ <span id=""></span>
<div class="method_details ">
- <h3 class="signature " id="type_map-class_method">
+ <h3 class="signature " id="templates-instance_method">
- + (<tt>Hash</tt>) <strong>type_map</strong>
+ - (<tt>Hash</tt>) <strong>templates</strong> <span class="extras">(readonly)</span>
@@ -450,8 +502,12 @@ with all data given.</p>
</h3><div class="docstring">
<div class="discussion">
-
-<p>returns the type map</p>
+ <p class="note private">
+ <strong>This method is part of a private API.</strong>
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+</p>
+
+<p>get the tree of templates</p>
</div>
@@ -470,7 +526,7 @@ with all data given.</p>
&mdash;
<div class='inline'>
-<p>the mapping for types</p>
+<p>the template tree</p>
</div>
</li>
@@ -483,15 +539,15 @@ with all data given.</p>
<pre class="lines">
-40
-41
-42</pre>
+50
+51
+52</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 40</span>
+ <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 50</span>
-<span class='rubyid_def def kw'>def</span> <span class='rubyid_type_map identifier id'>type_map</span>
- <span class='rubyid_@@map ivar id'>@@map</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
+<span class='rubyid_def def kw'>def</span> <span class='rubyid_templates identifier id'>templates</span>
+ <span class='rubyid_@templates ivar id'>@templates</span>
<span class='rubyid_end end kw'>end</span>
</pre>
</td>
@@ -499,10 +555,12 @@ with all data given.</p>
</table>
</div>
+
+ <span id=""></span>
<div class="method_details ">
- <h3 class="signature " id="type_map=-class_method">
+ <h3 class="signature " id="type_map-instance_method">
- + (<tt>Object</tt>) <strong>type_map=</strong>(map)
+ - (<tt>Hash</tt>) <strong>type_map</strong> <span class="extras">(readonly)</span>
@@ -511,32 +569,18 @@ with all data given.</p>
</h3><div class="docstring">
<div class="discussion">
-<p>save a mapping hash for the type</p>
-
-<p>With that it is possible to map long and complex contant types to simpler
-representations. These get then used in the finding process for the best
-fitting template.</p>
+<p>returns the hash of type conversions</p>
</div>
</div>
<div class="tags">
- <div class="examples">
- <p class="tag_title">Examples:</p>
-
-
- <pre class="example code"><span class='rubyid_Zero constant id'>Zero</span><span class='colon2 op'>::</span><span class='rubyid_Renderer constant id'>Renderer</span><span class='dot token'>.</span><span class='rubyid_map identifier id'>map</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='string val'>'text/html'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>'html'</span><span class='rbrace token'>}</span>
-</pre>
-
- </div>
-<p class="tag_title">Parameters:</p>
-<ul class="param">
+<p class="tag_title">Returns:</p>
+<ul class="return">
<li>
- <span class='name'>map</span>
-
<span class='type'>(<tt>Hash</tt>)</span>
@@ -544,29 +588,28 @@ fitting template.</p>
&mdash;
<div class='inline'>
-<p>maps the content type to a simple representation</p>
+<p>type conversion</p>
</div>
</li>
</ul>
-
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
-34
-35
-36</pre>
+43
+44
+45</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 34</span>
+ <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 43</span>
-<span class='rubyid_def def kw'>def</span> <span class='rubyid_type_map= identifier id'>type_map=</span><span class='lparen token'>(</span><span class='rubyid_map identifier id'>map</span><span class='rparen token'>)</span>
- <span class='rubyid_@@map ivar id'>@@map</span> <span class='assign token'>=</span> <span class='rubyid_map identifier id'>map</span>
+<span class='rubyid_def def kw'>def</span> <span class='rubyid_type_map identifier id'>type_map</span>
+ <span class='rubyid_@type_map ivar id'>@type_map</span>
<span class='rubyid_end end kw'>end</span>
</pre>
</td>
@@ -576,14 +619,15 @@ fitting template.</p>
</div>
+
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
- <h3 class="signature first" id="render-instance_method">
+ <h3 class="signature first" id="read_template_path!-instance_method">
- - (<tt>String</tt>) <strong>render</strong>
+ - (<tt>Self</tt>) <strong>read_template_path!</strong>
@@ -592,7 +636,11 @@ fitting template.</p>
</h3><div class="docstring">
<div class="discussion">
-<p>render the template within the context</p>
+<p>load the template tree</p>
+
+<p>This method gets all templates in the `template_path` and builds an
+internal tree structure, where templates and types direct the request to
+the wanted template.</p>
</div>
@@ -605,13 +653,13 @@ fitting template.</p>
<li>
- <span class='type'>(<tt>String</tt>)</span>
+ <span class='type'>(<tt>Self</tt>)</span>
&mdash;
<div class='inline'>
-<p>the rendered template</p>
+<p>returns the object</p>
</div>
</li>
@@ -624,15 +672,154 @@ fitting template.</p>
<pre class="lines">
-57
58
-59</pre>
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 58</span>
+
+<span class='rubyid_def def kw'>def</span> <span class='rubyid_read_template_path! fid id'>read_template_path!</span>
+ <span class='comment val'># TODO clean up later</span>
+ <span class='rubyid_@templates ivar id'>@templates</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
+ <span class='rubyid_search_files identifier id'>search_files</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_file identifier id'>file</span><span class='bitor op'>|</span>
+ <span class='rubyid_parts identifier id'>parts</span> <span class='assign token'>=</span> <span class='rubyid_file identifier id'>file</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='dregexp node'>/#{template_path}/</span><span class='comma token'>,</span> <span class='string val'>''</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_split identifier id'>split</span><span class='lparen token'>(</span><span class='string val'>'.'</span><span class='rparen token'>)</span>
+ <span class='rubyid_@templates ivar id'>@templates</span><span class='lbrack token'>[</span><span class='rubyid_parts identifier id'>parts</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
+ <span class='rubyid_if if kw'>if</span> <span class='rubyid_parts identifier id'>parts</span><span class='dot token'>.</span><span class='rubyid_count identifier id'>count</span> <span class='gt op'>&gt;</span> <span class='integer val'>2</span> <span class='rubyid_then then kw'>then</span>
+ <span class='rubyid_read_type identifier id'>read_type</span><span class='lparen token'>(</span><span class='rubyid_parts identifier id'>parts</span><span class='lbrack token'>[</span><span class='integer val'>1</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_type identifier id'>type</span><span class='bitor op'>|</span>
+ <span class='rubyid_@templates ivar id'>@templates</span><span class='lbrack token'>[</span><span class='rubyid_parts identifier id'>parts</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_type identifier id'>type</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_file identifier id'>file</span>
+ <span class='rubyid_end end kw'>end</span>
+ <span class='rubyid_else else kw'>else</span>
+ <span class='rubyid_@templates ivar id'>@templates</span><span class='lbrack token'>[</span><span class='rubyid_parts identifier id'>parts</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='string val'>''</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_file identifier id'>file</span>
+ <span class='rubyid_end end kw'>end</span>
+ <span class='rubyid_end end kw'>end</span>
+<span class='rubyid_end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ <div class="method_details ">
+ <h3 class="signature " id="render-instance_method">
+
+ - (<tt>String</tt>) <strong>render</strong>(name, type, context)
+
+
+
+
+
+</h3><div class="docstring">
+ <div class="discussion">
+
+<p>render a template</p>
+
+<p>This method will render the given template, based on the type in the given
+context.</p>
+
+
+ </div>
+</div>
+<div class="tags">
+ <p class="tag_title">Parameters:</p>
+<ul class="param">
+
+ <li>
+
+ <span class='name'>name</span>
+
+
+ <span class='type'>(<tt>String</tt>)</span>
+
+
+
+ &mdash;
+ <div class='inline'>
+<p>the name of the template</p>
+</div>
+
+ </li>
+
+ <li>
+
+ <span class='name'>type</span>
+
+
+ <span class='type'>(<tt>Array</tt>)</span>
+
+
+
+ &mdash;
+ <div class='inline'>
+<p>a list of accept types used to find the template</p>
+</div>
+
+ </li>
+
+ <li>
+
+ <span class='name'>context</span>
+
+
+ <span class='type'>(<tt>Object</tt>)</span>
+
+
+
+ &mdash;
+ <div class='inline'>
+<p>the context in which to evaluate the template</p>
+</div>
+
+ </li>
+
+</ul>
+
+<p class="tag_title">Returns:</p>
+<ul class="return">
+
+ <li>
+
+
+ <span class='type'>(<tt>String</tt>)</span>
+
+
+
+ &mdash;
+ <div class='inline'>
+<p>the rendered content</p>
+</div>
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+82
+83
+84</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 57</span>
+ <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 82</span>
-<span class='rubyid_def def kw'>def</span> <span class='rubyid_render identifier id'>render</span>
- <span class='rubyid_Tilt constant id'>Tilt</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_@path ivar id'>@path</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_render identifier id'>render</span><span class='lparen token'>(</span><span class='rubyid_@context ivar id'>@context</span><span class='rparen token'>)</span>
+<span class='rubyid_def def kw'>def</span> <span class='rubyid_render identifier id'>render</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_type identifier id'>type</span><span class='comma token'>,</span> <span class='rubyid_context identifier id'>context</span><span class='rparen token'>)</span>
+ <span class='rubyid_template identifier id'>template</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_type identifier id'>type</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_render identifier id'>render</span><span class='lparen token'>(</span><span class='rubyid_context identifier id'>context</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
</td>
@@ -645,7 +832,7 @@ fitting template.</p>
</div>
<div id="footer">
- Generated on Mon Nov 26 21:40:01 2012 by
+ Generated on Mon Nov 26 21:45:20 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.3 (ruby-1.9.3).
</div>