doc/classes/SDL4R.html in sdl4r-0.9.5 vs doc/classes/SDL4R.html in sdl4r-0.9.6

- old
+ new

@@ -1,10 +1,13 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<?xml version="1.0" encoding="utf-8"?> +<!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> - <title>Module: SDL4R [RDoc: Simple Declarative Language for Ruby]</title> + <title>Module: SDL4R</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ @@ -20,190 +23,122 @@ elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; - + if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } - + // Make codeblocks hidden by default - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) - + document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) + // ]]> </script> </head> <body> + <div id="classHeader"> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Module</strong></td> <td class="class-name-in-header">SDL4R</td> </tr> <tr class="top-aligned-row"> <td><strong>In:</strong></td> <td> - - <a href="../files/lib/sdl4r/sdl_time_span_rb.html"> - lib/sdl4r/sdl_time_span.rb - </a> - - <br /> - - <a href="../files/lib/sdl4r/sdl_parse_error_rb.html"> - lib/sdl4r/sdl_parse_error.rb - </a> - - <br /> - - <a href="../files/lib/sdl4r/tag_rb.html"> - lib/sdl4r/tag.rb - </a> - - <br /> - - <a href="../files/lib/sdl4r/parser_rb.html"> - lib/sdl4r/parser.rb - </a> - - <br /> - - <a href="../files/lib/sdl4r/sdl_binary_rb.html"> - lib/sdl4r/sdl_binary.rb - </a> - - <br /> - - <a href="../files/lib/sdl4r/parser/reader_rb.html"> - lib/sdl4r/parser/reader.rb - </a> - - <br /> - - <a href="../files/lib/sdl4r/parser/tokenizer_rb.html"> - lib/sdl4r/parser/tokenizer.rb - </a> - - <br /> - - <a href="../files/lib/sdl4r/parser/token_rb.html"> - lib/sdl4r/parser/token.rb - </a> - - <br /> - - <a href="../files/lib/sdl4r/parser/time_span_with_zone_rb.html"> - lib/sdl4r/parser/time_span_with_zone.rb - </a> - - <br /> - - <a href="../files/lib/sdl4r/sdl4r_rb.html"> - lib/sdl4r/sdl4r.rb - </a> - - <br /> - </td> </tr> - </table> </div> <!-- banner header --> <div id="bodyContent"> + + <div id="contextContent"> <div id="description"> - <hr size="1"></hr><p> + <p> Gathers utility methods. </p> </div> + </div> - <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> - - <a href="#M000001">SdlBinary</a>&nbsp;&nbsp; - - <a href="#M000004">coerce_or_fail</a>&nbsp;&nbsp; - - <a href="#M000002">format</a>&nbsp;&nbsp; - - <a href="#M000003">new_date_time</a>&nbsp;&nbsp; - - <a href="#M000006">read</a>&nbsp;&nbsp; - - <a href="#M000009">to_attribute_map</a>&nbsp;&nbsp; - - <a href="#M000007">to_value</a>&nbsp;&nbsp; - - <a href="#M000008">to_value_array</a>&nbsp;&nbsp; - - <a href="#M000005">validate_identifier</a>&nbsp;&nbsp; - + <a href="#M000001">SdlBinary</a>&nbsp;&nbsp; + <a href="#M000004">coerce_or_fail</a>&nbsp;&nbsp; + <a href="#M000002">format</a>&nbsp;&nbsp; + <a href="#M000003">new_date_time</a>&nbsp;&nbsp; + <a href="#M000006">read</a>&nbsp;&nbsp; + <a href="#M000009">to_attribute_map</a>&nbsp;&nbsp; + <a href="#M000007">to_value</a>&nbsp;&nbsp; + <a href="#M000008">to_value_array</a>&nbsp;&nbsp; + <a href="#M000005">validate_identifier</a>&nbsp;&nbsp; </div> </div> </div> + <!-- if includes --> <div id="section"> <div id="class-list"> @@ -220,95 +155,73 @@ <div id="constants-list"> <h3 class="section-bar">Constants</h3> <div class="name-list"> <table summary="Constants"> - <tr class="top-aligned-row context-row"> <td class="context-item-name">MAX_INTEGER_32</td> <td>=</td> <td class="context-item-value">2**31 - 1</td> - </tr> - <tr class="top-aligned-row context-row"> <td class="context-item-name">MIN_INTEGER_32</td> <td>=</td> <td class="context-item-value">-(2**31)</td> - </tr> - <tr class="top-aligned-row context-row"> <td class="context-item-name">MAX_INTEGER_64</td> <td>=</td> <td class="context-item-value">2**63 - 1</td> - </tr> - <tr class="top-aligned-row context-row"> <td class="context-item-name">MIN_INTEGER_64</td> <td>=</td> <td class="context-item-value">-(2**63)</td> - </tr> - <tr class="top-aligned-row context-row"> <td class="context-item-name">BASE64_WRAP_LINE_LENGTH</td> <td>=</td> <td class="context-item-value">72</td> - </tr> - <tr class="top-aligned-row context-row"> <td class="context-item-name">ESCAPED_QUOTES</td> <td>=</td> <td class="context-item-value">{ &quot;\&quot;&quot; =&gt; &quot;\\\&quot;&quot;, &quot;'&quot; =&gt; &quot;\\'&quot;, &quot;`&quot; =&gt; &quot;\\`&quot;, }</td> - </tr> - <tr class="top-aligned-row context-row"> <td class="context-item-name">ESCAPED_CHARS</td> <td>=</td> <td class="context-item-value">{ &quot;\\&quot; =&gt; &quot;\\\\&quot;, &quot;\t&quot; =&gt; &quot;\\t&quot;, &quot;\r&quot; =&gt; &quot;\\r&quot;, &quot;\n&quot; =&gt; &quot;\\n&quot;, }</td> - </tr> - </table> </div> </div> + - <!-- if method_list --> + <!-- if method_list --> <div id="methods"> - <h3 class="section-bar">Public Class methods</h3> - <div id="method-M000001" class="method-detail"> <a name="M000001"></a> <div class="method-heading"> - <a href="#M000001" class="method-signature"> - <span class="method-name">SdlBinary</span><span class="method-args">(o)</span> - </a> - </div> - + <div class="method-description"> - <p> Try to coerce &#8216;o&#8217; into a <a href="SDL4R.html#M000001">SdlBinary</a>. Raise an ArgumentError if it fails. </p> - <p><a class="source-toggle" href="#" onclick="toggleCode('M000001-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000001-source"> <pre> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 72</span> @@ -321,30 +234,23 @@ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;can't coerce argument&quot;</span> <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">end</span> </pre> </div> - </div> </div> - <div id="method-M000004" class="method-detail"> <a name="M000004"></a> <div class="method-heading"> - <a href="#M000004" class="method-signature"> - <span class="method-name">coerce_or_fail</span><span class="method-args">(o)</span> - </a> - </div> - + <div class="method-description"> - <p> Coerce the type to a standard SDL type or raises an ArgumentError. </p> <p> Returns <tt>o</tt> if of the following classes: NilClass, String, Numeric, @@ -353,11 +259,10 @@ href="SDL4R.html#M000001">SdlBinary</a>, </p> <p> Rationals are turned into Floats using Rational#to_f. </p> - <p><a class="source-toggle" href="#" onclick="toggleCode('M000004-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000004-source"> <pre> <span class="ruby-comment cmt"># File lib/sdl4r/sdl4r.rb, line 151</span> @@ -384,49 +289,41 @@ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;#{o.class.name} is not coercible to an SDL type&quot;</span> <span class="ruby-keyword kw">end</span> </pre> </div> - </div> </div> - <div id="method-M000002" class="method-detail"> <a name="M000002"></a> <div class="method-heading"> - <a href="#M000002" class="method-signature"> - <span class="method-name">format</span><span class="method-args">(o, add_quotes = true, line_prefix = &quot;&quot;, indent = &quot;\t&quot;)</span> - </a> - </div> - + <div class="method-description"> - <p> Creates an SDL string representation for a given object and returns it. </p> <table> -<tr><td valign="top"><tt>o</tt>:</td><td>the object to format +<tr><td valign="top"><tt>o</tt>:</td><td>the object to <a href="SDL4R.html#M000002">format</a> </td></tr> <tr><td valign="top"><tt>add_quotes</tt>:</td><td>indicates whether quotes will be added to Strings and characters (true by default) </td></tr> -<tr><td valign="top"><tt>line_prefix</tt>:</td><td>the line prefix to use (&#8220;&#8221; by default) +<tr><td valign="top"><tt>line_prefix</tt>:</td><td>the line prefix to use (&quot;&quot; by default) </td></tr> -<tr><td valign="top"><tt>indent</tt>:</td><td>the indent string to use (&#8220;t&#8220; by default) +<tr><td valign="top"><tt>indent</tt>:</td><td>the indent string to use (&quot;\t&quot; by default) </td></tr> </table> - <p><a class="source-toggle" href="#" onclick="toggleCode('M000002-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000002-source"> <pre> <span class="ruby-comment cmt"># File lib/sdl4r/sdl4r.rb, line 44</span> @@ -514,30 +411,23 @@ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">end</span> </pre> </div> - </div> </div> - <div id="method-M000003" class="method-detail"> <a name="M000003"></a> <div class="method-heading"> - <a href="#M000003" class="method-signature"> - <span class="method-name">new_date_time</span><span class="method-args">(year, month, day, hour, min, sec, time_zone_offset)</span> - </a> - </div> - + <div class="method-description"> - <p> Creates and returns the object representing a datetime (DateTime in the default implementation). This method is, by default, called by the <a href="SDL4R/Parser.html">Parser</a> class. It could be overriden as follows in order to get Time instances from all the <a href="SDL4R.html">SDL4R</a> @@ -548,43 +438,35 @@ def self.new_date_time(year, month, day, hour, min, sec, time_zone_offset) Time.utc(year, month, day, hour, min, sec) end end </pre> - <p><a class="source-toggle" href="#" onclick="toggleCode('M000003-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000003-source"> <pre> <span class="ruby-comment cmt"># File lib/sdl4r/sdl4r.rb, line 139</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new_date_time</span>(<span class="ruby-identifier">year</span>, <span class="ruby-identifier">month</span>, <span class="ruby-identifier">day</span>, <span class="ruby-identifier">hour</span>, <span class="ruby-identifier">min</span>, <span class="ruby-identifier">sec</span>, <span class="ruby-identifier">time_zone_offset</span>) <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-identifier">year</span>, <span class="ruby-identifier">month</span>, <span class="ruby-identifier">day</span>, <span class="ruby-identifier">hour</span>, <span class="ruby-identifier">min</span>, <span class="ruby-identifier">sec</span>, <span class="ruby-identifier">time_zone_offset</span>) <span class="ruby-keyword kw">end</span> </pre> </div> - </div> </div> - <div id="method-M000006" class="method-detail"> <a name="M000006"></a> <div class="method-heading"> - <a href="#M000006" class="method-signature"> - <span class="method-name">read</span><span class="method-args">(input)</span> - </a> - </div> - + <div class="method-description"> - <p> -Creates and returns a tag named &#8220;root&#8221; and add all the tags +Creates and returns a tag named &quot;root&quot; and add all the tags specified in the given <tt>input</tt>. </p> <table> <tr><td valign="top"><tt>input</tt>:</td><td>String, IO, Pathname or URI. @@ -605,41 +487,33 @@ root = SDL4R::read(io) } root = SDL4R::read(URI.new(&quot;http://my_site/my_file.sdl&quot;)) </pre> - <p><a class="source-toggle" href="#" onclick="toggleCode('M000006-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000006-source"> <pre> <span class="ruby-comment cmt"># File lib/sdl4r/sdl4r.rb, line 232</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">input</span>) <span class="ruby-constant">Tag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;root&quot;</span>).<span class="ruby-identifier">read</span>(<span class="ruby-identifier">input</span>) <span class="ruby-keyword kw">end</span> </pre> </div> - </div> </div> - <div id="method-M000009" class="method-detail"> <a name="M000009"></a> <div class="method-heading"> - <a href="#M000009" class="method-signature"> - <span class="method-name">to_attribute_map</span><span class="method-args">(s)</span> - </a> - </div> - + <div class="method-description"> - <p> Parse a string representing the attributes portion of an SDL tag and return the results as a map. </p> <p> @@ -648,11 +522,10 @@ <pre> hash = SDL4R.to_attribute_hash(&quot;value=1 debugging=on time=12:24:01&quot;); # { &quot;value&quot; =&gt; 1, &quot;debugging&quot; =&gt; true, &quot;time&quot; =&gt; SdlTimeSpan.new(12, 24, 01) } </pre> - <p><a class="source-toggle" href="#" onclick="toggleCode('M000009-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000009-source"> <pre> <span class="ruby-comment cmt"># File lib/sdl4r/sdl4r.rb, line 270</span> @@ -660,39 +533,31 @@ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;'s' cannot be null&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">read</span>(<span class="ruby-value str">&quot;atts &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">s</span>).<span class="ruby-identifier">child</span>.<span class="ruby-identifier">attributes</span> <span class="ruby-keyword kw">end</span> </pre> </div> - </div> </div> - <div id="method-M000007" class="method-detail"> <a name="M000007"></a> <div class="method-heading"> - <a href="#M000007" class="method-signature"> - <span class="method-name">to_value</span><span class="method-args">(s)</span> - </a> - </div> - + <div class="method-description"> - <p> Parses and returns the value corresponding with the specified SDL literal. </p> <pre> SDL4R.to_value(&quot;\&quot;abcd\&quot;&quot;) # =&gt; &quot;abcd&quot; SDL4R.to_value(&quot;1&quot;) # =&gt; 1 SDL4R.to_value(&quot;null&quot;) # =&gt; nil </pre> - <p><a class="source-toggle" href="#" onclick="toggleCode('M000007-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000007-source"> <pre> <span class="ruby-comment cmt"># File lib/sdl4r/sdl4r.rb, line 242</span> @@ -700,30 +565,23 @@ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;'s' cannot be null&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">read</span>(<span class="ruby-identifier">s</span>).<span class="ruby-identifier">child</span>.<span class="ruby-identifier">value</span> <span class="ruby-keyword kw">end</span> </pre> </div> - </div> </div> - <div id="method-M000008" class="method-detail"> <a name="M000008"></a> <div class="method-heading"> - <a href="#M000008" class="method-signature"> - <span class="method-name">to_value_array</span><span class="method-args">(s)</span> - </a> - </div> - + <div class="method-description"> - <p> Parse the string of values and return a list. The string is handled as if it is the values portion of an SDL tag. </p> <p> @@ -733,11 +591,10 @@ array = SDL4R.to_value_array(&quot;1 true 12:24:01&quot;) </pre> <p> Will return an int, a boolean, and a time span. </p> - <p><a class="source-toggle" href="#" onclick="toggleCode('M000008-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000008-source"> <pre> <span class="ruby-comment cmt"># File lib/sdl4r/sdl4r.rb, line 256</span> @@ -745,30 +602,23 @@ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;'s' cannot be null&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">read</span>(<span class="ruby-identifier">s</span>).<span class="ruby-identifier">child</span>.<span class="ruby-identifier">values</span> <span class="ruby-keyword kw">end</span> </pre> </div> - </div> </div> - <div id="method-M000005" class="method-detail"> <a name="M000005"></a> <div class="method-heading"> - <a href="#M000005" class="method-signature"> - <span class="method-name">validate_identifier</span><span class="method-args">(identifier)</span> - </a> - </div> - + <div class="method-description"> - <p> Validates an SDL identifier String. SDL Identifiers must start with a Unicode letter or underscore (_) and contain only unicode letters, digits, underscores (_), dashes(-) and periods (.). </p> @@ -777,11 +627,10 @@ ArgumentError if the identifier is not legal </p> <p> TODO: support UTF-8 identifiers </p> - <p><a class="source-toggle" href="#" onclick="toggleCode('M000005-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000005-source"> <pre> <span class="ruby-comment cmt"># File lib/sdl4r/sdl4r.rb, line 184</span> @@ -812,24 +661,21 @@ <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">end</span> </pre> </div> - </div> </div> - </div> - - </div> + <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> -</html> +</html> \ No newline at end of file