doc/classes/SDL4R/SdlBinary.html in sdl4r-0.9.6 vs doc/classes/SDL4R/SdlBinary.html in sdl4r-0.9.7

- old
+ new

@@ -1,303 +1,188 @@ -<?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>Class: SDL4R::SdlBinary</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[ - - function popupCode( url ) { - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") - } - - function toggleCode( id ) { - if ( document.getElementById ) - elem = document.getElementById( id ); - else if ( document.all ) - 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>" ) - - // ]]> - </script> - -</head> -<body> - - - - <div id="classHeader"> - <table class="header-table"> - <tr class="top-aligned-row"> - <td><strong>Class</strong></td> - <td class="class-name-in-header">SDL4R::SdlBinary</td> - </tr> - <tr class="top-aligned-row"> - <td><strong>In:</strong></td> - <td> - <a href="../../files/lib/sdl4r/sdl_binary_rb.html"> - lib/sdl4r/sdl_binary.rb - </a> - <br /> - </td> - </tr> - - <tr class="top-aligned-row"> - <td><strong>Parent:</strong></td> - <td> - Object - </td> - </tr> - </table> - </div> - <!-- banner header --> - - <div id="bodyContent"> - - - - <div id="contextContent"> - - <div id="description"> - <p> -Represents a binary value. -</p> -<p> -This class was introduced to avoid the confusion between a Ruby String and -a binary literal. -</p> - - </div> - - - </div> - - <div id="method-list"> - <h3 class="section-bar">Methods</h3> - - <div class="name-list"> - <a href="#M000056">==</a>&nbsp;&nbsp; - <a href="#M000060">decode64</a>&nbsp;&nbsp; - <a href="#M000057">eql?</a>&nbsp;&nbsp; - <a href="#M000058">hash</a>&nbsp;&nbsp; - <a href="#M000055">new</a>&nbsp;&nbsp; - <a href="#M000059">to_s</a>&nbsp;&nbsp; - </div> - </div> - - </div> - - - <!-- if includes --> - - <div id="section"> - - - - - - <div id="attribute-list"> - <h3 class="section-bar">Attributes</h3> - - <div class="name-list"> - <table> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">bytes</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - </table> - </div> - </div> - - - - <!-- if method_list --> - <div id="methods"> - <h3 class="section-bar">Public Class methods</h3> - - <div id="method-M000060" class="method-detail"> - <a name="M000060"></a> - - <div class="method-heading"> - <a href="#M000060" class="method-signature"> - <span class="method-name">decode64</span><span class="method-args">(s)</span> - </a> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html lang='en'> + <head> + <title>: SDL4R::SdlBinary [RDoc: Simple Declarative Language for Ruby]</title> + <meta content='text/html; charset=utf-8' http-equiv='Content-Type'> + <link href='../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'> + <script type='text/javascript'> + //<![CDATA[ + function popupCode(url) { + window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") + } + + function toggleCode(id) { + var code = document.getElementById(id) + + code.style.display = code.style.display != 'block' ? 'block' : 'none' + return true + } + + // Make codeblocks hidden by default + document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>') + //]]> + </script> + </head> + <body class='page'> + <div class='class' id='wrapper'> + <div class='header'> + <h1 class='name'> + <span class='type'>Class</span> + SDL4R::SdlBinary + </h1> + <ol class='paths'> + <li> + <a href="../../files/lib/sdl4r/sdl_binary_rb.html">lib/sdl4r/sdl_binary.rb</a> + </li> + </ol> + <div class='parent'> + Parent: + <strong>Object</strong> </div> - - <div class="method-description"> - <p> -Decodes the specified base-64 encoded string and returns a corresponding <a -href="SdlBinary.html">SdlBinary</a> instance. <tt>s</tt> might not include -the conventional starting and ending square brackets. -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000060-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000060-source"> -<pre> -<span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 57</span> - <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">s</span>) - <span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;\n\r\t &quot;</span>) - - <span class="ruby-identifier">binary</span> = <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">s</span>) - - <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">binary</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">empty?</span> - <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;bad binary literal&quot;</span> - <span class="ruby-keyword kw">end</span> - - <span class="ruby-keyword kw">return</span> <span class="ruby-constant">SdlBinary</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">binary</span>) - <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> </div> - - <div id="method-M000055" class="method-detail"> - <a name="M000055"></a> - - <div class="method-heading"> - <a href="#M000055" class="method-signature"> - <span class="method-name">new</span><span class="method-args">(bytes)</span> - </a> - </div> - - <div class="method-description"> - <p> -<tt>value</tt>: a String containing the bytes -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000055-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000055-source"> -<pre> -<span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 33</span> - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">bytes</span>) - <span class="ruby-ivar">@bytes</span> = <span class="ruby-identifier">bytes</span> - <span class="ruby-keyword kw">end</span> -</pre> + <div id='content'> + <div id='text'> + <div id='description'> + <p> + Represents a binary value. + </p> + <p> + This class was introduced to avoid the confusion between a Ruby String and + a binary literal. + </p> </div> - </div> - </div> - - <h3 class="section-bar">Public Instance methods</h3> - - <div id="method-M000056" class="method-detail"> - <a name="M000056"></a> - - <div class="method-heading"> - <a href="#M000056" class="method-signature"> - <span class="method-name">==</span><span class="method-args">(o)</span> - </a> - </div> - - <div class="method-description"> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000056-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000056-source"> -<pre> -<span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 37</span> - <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">o</span>) - <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">equal?</span>(<span class="ruby-identifier">o</span>) - <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>) - <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bytes</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">bytes</span> - <span class="ruby-keyword kw">end</span> -</pre> + <div id='method-list'> + <h2>Methods</h2> + <h3>public class</h3> + <ol> + <li><a href="#M000089">decode64</a></li> + <li><a href="#M000084">new</a></li> + </ol> + <h3>public instance</h3> + <ol> + <li><a href="#M000085">==</a></li> + <li><a href="#M000086">eql?</a></li> + <li><a href="#M000087">hash</a></li> + <li><a href="#M000088">to_s</a></li> + </ol> </div> - </div> - </div> - - <div id="method-M000057" class="method-detail"> - <a name="M000057"></a> - - <div class="method-heading"> - <span class="method-name">eql?</span><span class="method-args">(o)</span> - </div> - - <div class="method-description"> - <p> -Alias for #== -</p> - </div> - </div> - - <div id="method-M000058" class="method-detail"> - <a name="M000058"></a> - - <div class="method-heading"> - <a href="#M000058" class="method-signature"> - <span class="method-name">hash</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000058-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000058-source"> -<pre> -<span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 45</span> - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash</span> - <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">hash</span> - <span class="ruby-keyword kw">end</span> -</pre> + <div id='section'> + <div id='attribute-list'> + <h2 class='section-bar'>Attributes</h2> + <div class='name-list'> + <table> + <tr class='top-aligned-row context-row'> + <td class='context-item-name'>bytes</td> + <td class='context-item-value'>[RW]</td> + <td class='context-item-desc'></td> + </tr> + </table> + </div> + </div> + <div id='methods'> + <h2>Public class methods</h2> + <div class='method public-class' id='method-M000089'> + <a name='M000089'></a> + <div class='synopsis'> + <span class='name'>decode64</span> + <span class='arguments'>(s)</span> + </div> + <div class='description'> + <p> + Decodes the specified base-64 encoded string and returns a corresponding <a + href="SdlBinary.html">SdlBinary</a> instance. <tt>s</tt> might not include + the conventional starting and ending square brackets. + </p> + </div> + <div class='source'> + <a class='source-toggle' href='#' onclick="toggleCode('M000089-source'); return false"> + [show source] + </a> + <pre id='M000089-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 57</span>&#x000A;57: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">s</span>)&#x000A;58: <span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;\n\r\t &quot;</span>)&#x000A;59: &#x000A;60: <span class="ruby-identifier">binary</span> = <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">s</span>)&#x000A;61: &#x000A;62: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">binary</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">empty?</span>&#x000A;63: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;bad binary literal&quot;</span>&#x000A;64: <span class="ruby-keyword kw">end</span>&#x000A;65: &#x000A;66: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">SdlBinary</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">binary</span>)&#x000A;67: <span class="ruby-keyword kw">end</span></pre> + </div> + </div> + <div class='method public-class' id='method-M000084'> + <a name='M000084'></a> + <div class='synopsis'> + <span class='name'>new</span> + <span class='arguments'>(bytes)</span> + </div> + <div class='description'> + <p> + <tt>value</tt>: a String containing the bytes + </p> + </div> + <div class='source'> + <a class='source-toggle' href='#' onclick="toggleCode('M000084-source'); return false"> + [show source] + </a> + <pre id='M000084-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 33</span>&#x000A;33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">bytes</span>)&#x000A;34: <span class="ruby-ivar">@bytes</span> = <span class="ruby-identifier">bytes</span>&#x000A;35: <span class="ruby-keyword kw">end</span></pre> + </div> + </div> + <h2>Public instance methods</h2> + <div class='method public-instance' id='method-M000085'> + <a name='M000085'></a> + <div class='synopsis'> + <span class='name'>==</span> + <span class='arguments'>(o)</span> + </div> + <div class='source'> + <a class='source-toggle' href='#' onclick="toggleCode('M000085-source'); return false"> + [show source] + </a> + <pre id='M000085-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 37</span>&#x000A;37: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">o</span>)&#x000A;38: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">equal?</span>(<span class="ruby-identifier">o</span>)&#x000A;39: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)&#x000A;40: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bytes</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">bytes</span>&#x000A;41: <span class="ruby-keyword kw">end</span></pre> + </div> + </div> + <div class='method public-instance' id='method-M000086'> + <a name='M000086'></a> + <div class='synopsis'> + <span class='name'>eql?</span> + <span class='arguments'>(o)</span> + </div> + <div class='description'> + <p> + Alias for #== + </p> + </div> + </div> + <div class='method public-instance' id='method-M000087'> + <a name='M000087'></a> + <div class='synopsis'> + <span class='name'>hash</span> + <span class='arguments'>()</span> + </div> + <div class='source'> + <a class='source-toggle' href='#' onclick="toggleCode('M000087-source'); return false"> + [show source] + </a> + <pre id='M000087-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 45</span>&#x000A;45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash</span>&#x000A;46: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">hash</span>&#x000A;47: <span class="ruby-keyword kw">end</span></pre> + </div> + </div> + <div class='method public-instance' id='method-M000088'> + <a name='M000088'></a> + <div class='synopsis'> + <span class='name'>to_s</span> + <span class='arguments'>()</span> + </div> + <div class='description'> + <p> + Returns the bytes base64-encoded. + </p> + </div> + <div class='source'> + <a class='source-toggle' href='#' onclick="toggleCode('M000088-source'); return false"> + [show source] + </a> + <pre id='M000088-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 50</span>&#x000A;50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>&#x000A;51: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">bytes</span>)&#x000A;52: <span class="ruby-keyword kw">end</span></pre> + </div> + </div> + </div> </div> </div> </div> - - <div id="method-M000059" class="method-detail"> - <a name="M000059"></a> - - <div class="method-heading"> - <a href="#M000059" class="method-signature"> - <span class="method-name">to_s</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p> -Returns the bytes base64-encoded. -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000059-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000059-source"> -<pre> -<span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 50</span> - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span> - <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">bytes</span>) - <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - + <div id='footer-push'></div> </div> - - - </div> - - -<div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> -</div> - -</body> -</html> \ No newline at end of file + <div id='footer'> + <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a> + </div> + </body> +</html>