doc/Attrtastic/SemanticAttributesHelper.html in attrtastic-0.2.2 vs doc/Attrtastic/SemanticAttributesHelper.html in attrtastic-0.3.0

- old
+ new

@@ -1,10 +1,10 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <meta name="Content-Type" content="text/html; charset=UTF-8" /> + <meta name="Content-Type" content="text/html; charset=utf-8" /> <title>Module: Attrtastic::SemanticAttributesHelper</title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" /> <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" /> <script type="text/javascript" charset="utf-8"> @@ -22,11 +22,11 @@ <div id="header"> <div id="menu"> <a href="../_index.html">Index (S)</a> &raquo; - <span class='title'><a href="../Attrtastic.html" title="Attrtastic (module)">Attrtastic</a></span> + <span class='title'><span class='object_link'><a href="../Attrtastic.html" title="Attrtastic (module)">Attrtastic</a></span></span> &raquo; <span class="title">SemanticAttributesHelper</span> <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div> @@ -41,25 +41,27 @@ <div class="clear"></div> </div> <iframe id="search_frame"></iframe> - <div id="content"><h1>Module: Attrtastic::SemanticAttributesHelper + <div id="content"><h1>Module: Attrtastic::SemanticAttributesHelper + </h1> <dl class="box"> + <dt class="r1 last">Defined in:</dt> - <dd class="r1 last">lib/attrtastic.rb</dd> + <dd class="r1 last">lib/attrtastic/semantic_attributes_helper.rb</dd> </dl> <div class="clear"></div> <h2>Overview</h2><div class="docstring"> @@ -76,72 +78,79 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4></h4> - <pre class="example code"> <span class='const'>ActionView</span><span class='op'>::</span><span class='const'>Base</span><span class='period'>.</span><span class='id send'>send</span> <span class='symbol'>:include</span><span class='comma'>,</span> <span class='const'>Attrtastic</span><span class='op'>::</span><span class='const'>SemanticAttributesHelper</span></pre> + <h4><div class='inline'></div></h4> + <pre class="example code"><span class='const'>ActionView</span><span class='op'>::</span><span class='const'>Base</span><span class='period'>.</span><span class='id send'>send</span> <span class='symbol'>:include</span><span class='comma'>,</span> <span class='const'>Attrtastic</span><span class='op'>::</span><span class='const'>SemanticAttributesHelper</span></pre> - <h4> + <h4><div class='inline'><p> Example of useage - -</h4> - <pre class="example code"> &lt;% semantic_attributes_for @user do |attr| %&gt; - &lt;% attr.attributes &quot;User info&quot; do %&gt; - &lt;%= attr.attribute :name %&gt; - &lt;%= attr.attribute :email %&gt; - &lt;% end %&gt; - &lt;% attr.attributes &quot;User details&quot; do %&gt; - &lt;%= attr.attribute :weight %&gt; - &lt;%= attr.attribute :height %&gt; - &lt;%= attr.attribute :age %&gt; - &lt;% end %&gt; - &lt;% end %&gt;</pre> +</p> +</div></h4> + <pre class="example code">&lt;%= semantic_attributes_for @user do |attr| %&gt; + &lt;%= attr.attributes &quot;User info&quot; do %&gt; + &lt;%= attr.attribute :name %&gt; + &lt;%= attr.attribute :email %&gt; + &lt;% end %&gt; + &lt;%= attr.attributes &quot;User details&quot; do %&gt; + &lt;%= attr.attribute :weight %&gt; + &lt;%= attr.attribute :height %&gt; + &lt;%= attr.attribute :age %&gt; + &lt;% end %&gt; +&lt;% end %&gt;</pre> </div> </div> - <h2>Instance Method Summary</h2> + + <h2> + Instance Method Summary + <small>(<a href="#" class="summary_toggle">collapse</a>)</small> + </h2> - <ul class="summary"> - - <li class="public "> + <ul class="summary"> + + <li class="public "> <span class="summary_signature"> - <a href="#semantic_attributes_for-instance_method" title="#semantic_attributes_for (instance method)">- (Object) <strong>semantic_attributes_for</strong>(record, options = {}, &amp;block) {|attr| ... }</a> + <a href="#semantic_attributes_for-instance_method" title="#semantic_attributes_for (instance method)">- (Object) <strong>semantic_attributes_for</strong>(record, options = {}) {|attr| ... }</a> </span> + - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Creates attributes for given object. - -</span> +</p> +</div></span> </li> - - </ul> + + </ul> + + <div id="instance_method_details" class="method_details_list"> <h2>Instance Method Details</h2> <div class="method_details first"> <p class="signature first" id="semantic_attributes_for-instance_method"> - - (<tt>Object</tt>) <strong>semantic_attributes_for</strong>(record, options = {}, &amp;block) {|attr| ... } + - (<tt>Object</tt>) <strong>semantic_attributes_for</strong>(record, options = {}) {|attr| ... } </p><div class="docstring"> <div class="discussion"> @@ -159,19 +168,42 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4></h4> - <pre class="example code"> &lt;% semantic_attributes_for @user do |attr| %&gt; - &lt;% attr.attributes do %&gt; - &lt;%= attr.attribute :name %&gt; - &lt;%= attr.attribute :email %&gt; - &lt;% end %&gt; - &lt;% end %&gt;</pre> + <h4><div class='inline'></div></h4> + <pre class="example code">&lt;%= semantic_attributes_for @user do |attr| %&gt; + &lt;%= attr.attributes do %&gt; + &lt;%= attr.attribute :name %&gt; + &lt;%= attr.attribute :email %&gt; + &lt;% end %&gt; +&lt;% end %&gt;</pre> </div> +<h3>Parameters:</h3> +<ul class="param"> + + <li> + + <span class='type'>(<tt>Hash</tt>)</span> + + + <span class='name'>options</span> + + + <em class="default">(defaults to: <tt>{}</tt>)</em> + + + &mdash; + <div class='inline'><p> +a customizable set of options +</p> +</div> + + </li> + +</ul> @@ -186,20 +218,18 @@ &mdash; default: <tt>{}</tt> </span> - &mdash; + &mdash; <div class='inline'><p> Hash with optional :class html class name for html block - - +</p> +</div> </tr> </ul> - - <h3>Yields:</h3> <ul class="yield"> <li> @@ -207,35 +237,35 @@ &mdash; - + <div class='inline'><p> Block which is yield inside of markup - - +</p> +</div> </li> </ul> <h3>Yield Parameters:</h3> <ul class="yieldparam"> <li> - <span class='type'>(<tt><a href="SemanticAttributesBuilder.html" title="Attrtastic::SemanticAttributesBuilder (class)">SemanticAttributesBuilder</a></tt>)</span> + <span class='type'>(<tt><span class='object_link'><a href="SemanticAttributesBuilder.html" title="Attrtastic::SemanticAttributesBuilder (class)">SemanticAttributesBuilder</a></span></tt>)</span> <span class='name'>builder</span> &mdash; - + <div class='inline'><p> Builder for attributes for given AR record - - +</p> +</div> </li> </ul> @@ -243,31 +273,35 @@ <tr> <td> <pre class="lines"> -382 -383 -384 -385 -386 -387 -388 -389 -390</pre> +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/attrtastic.rb', line 382</span> + <pre class="code"><span class="info file"># File 'lib/attrtastic/semantic_attributes_helper.rb', line 41</span> <span class='kw'>def</span> <span class='id semantic_attributes_for'>semantic_attributes_for</span><span class='lparen'>(</span><span class='id record'>record</span><span class='comma'>,</span> <span class='id options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id block'>block</span><span class='rparen'>)</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:html</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='id html_class'>html_class</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>attrtastic</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id record'>record</span><span class='period'>.</span><span class='id class'>class</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='period'>.</span><span class='id underscore'>underscore</span><span class='comma'>,</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:html</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:class</span><span class='rbracket'>]</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id compact'>compact</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> - <span class='id concat'>concat</span><span class='lparen'>(</span><span class='id tag'>tag</span><span class='lparen'>(</span><span class='symbol'>:div</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:class</span> <span class='op'>=&gt;</span> <span class='id html_class'>html_class</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span><span class='rparen'>)</span> - <span class='kw'>yield</span> <span class='const'>SemanticAttributesBuilder</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id record'>record</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id block_given?'>block_given?</span> - <span class='id concat'>concat</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;/div&gt;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> + <span class='id output'>output</span> <span class='op'>=</span> <span class='id tag'>tag</span><span class='lparen'>(</span><span class='symbol'>:div</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:class</span> <span class='op'>=&gt;</span> <span class='id html_class'>html_class</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> + <span class='kw'>if</span> <span class='id block_given?'>block_given?</span> + <span class='id output'>output</span> <span class='op'>&lt;&lt;</span> <span class='id capture'>capture</span><span class='lparen'>(</span><span class='const'>SemanticAttributesBuilder</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id record'>record</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id block'>block</span><span class='rparen'>)</span> + <span class='kw'>end</span> + <span class='id output'>output</span><span class='period'>.</span><span class='id safe_concat'>safe_concat</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;/div&gt;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> @@ -275,12 +309,12 @@ </div> </div> <div id="footer"> - Generated on Fri Jan 15 21:15:12 2010 by - <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a> - 0.5.3 (ruby-1.9.1). + Generated on Fri Dec 3 21:43:44 2010 by + <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> + 0.6.3 (ruby-1.9.2). </div> </body> </html> \ No newline at end of file