twitter-status-bot/.gems/doc/json-1.8.1/rdoc/Rational.html

343 lines
11 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<title>Class: Rational</title>
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
<script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
<script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
<script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
</head>
<body id="top" class="class">
<div id="metadata">
<div id="home-metadata">
<div id="home-section" class="section">
<h3 class="section-header">
<a href="./index.html">Home</a>
<a href="./index.html#classes">Classes</a>
<a href="./index.html#methods">Methods</a>
</h3>
</div>
</div>
<div id="file-metadata">
<div id="file-list-section" class="section">
<h3 class="section-header">In Files</h3>
<div class="section-body">
<ul>
<li><a href="./lib/json/add/rational_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
class="thickbox" title="lib/json/add/rational.rb">lib/json/add/rational.rb</a></li>
</ul>
</div>
</div>
</div>
<div id="class-metadata">
<!-- Parent Class -->
<div id="parent-class-section" class="section">
<h3 class="section-header">Parent</h3>
<p class="link">Object</p>
</div>
<!-- Method Quickref -->
<div id="method-list-section" class="section">
<h3 class="section-header">Methods</h3>
<ul class="link-list">
<li><a href="#method-c-json_create">::json_create</a></li>
<li><a href="#method-i-as_json">#as_json</a></li>
<li><a href="#method-i-to_json">#to_json</a></li>
</ul>
</div>
</div>
<div id="project-metadata">
<div id="fileindex-section" class="section project-section">
<h3 class="section-header">Files</h3>
<ul>
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
</ul>
</div>
<div id="classindex-section" class="section project-section">
<h3 class="section-header">Class/Module Index
<span class="search-toggle"><img src="./images/find.png"
height="16" width="16" alt="[+]"
title="show/hide quicksearch" /></span></h3>
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
<fieldset>
<legend>Quicksearch</legend>
<input type="text" name="quicksearch" value=""
class="quicksearch-field" />
</fieldset>
</form>
<ul class="link-list">
<li><a href="./JSON.html">JSON</a></li>
<li><a href="./JSON/Ext.html">JSON::Ext</a></li>
<li><a href="./JSON/GeneratorError.html">JSON::GeneratorError</a></li>
<li><a href="./JSON/GenericObject.html">JSON::GenericObject</a></li>
<li><a href="./JSON/JSONError.html">JSON::JSONError</a></li>
<li><a href="./JSON/MissingUnicodeSupport.html">JSON::MissingUnicodeSupport</a></li>
<li><a href="./JSON/NestingError.html">JSON::NestingError</a></li>
<li><a href="./JSON/ParserError.html">JSON::ParserError</a></li>
<li><a href="./JSON/Pure.html">JSON::Pure</a></li>
<li><a href="./JSON/Pure/Generator.html">JSON::Pure::Generator</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods.html">JSON::Pure::Generator::GeneratorMethods</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods/Array.html">JSON::Pure::Generator::GeneratorMethods::Array</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods/FalseClass.html">JSON::Pure::Generator::GeneratorMethods::FalseClass</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods/Float.html">JSON::Pure::Generator::GeneratorMethods::Float</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods/Hash.html">JSON::Pure::Generator::GeneratorMethods::Hash</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods/Integer.html">JSON::Pure::Generator::GeneratorMethods::Integer</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods/NilClass.html">JSON::Pure::Generator::GeneratorMethods::NilClass</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods/Object.html">JSON::Pure::Generator::GeneratorMethods::Object</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods/String.html">JSON::Pure::Generator::GeneratorMethods::String</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods/String/Extend.html">JSON::Pure::Generator::GeneratorMethods::String::Extend</a></li>
<li><a href="./JSON/Pure/Generator/GeneratorMethods/TrueClass.html">JSON::Pure::Generator::GeneratorMethods::TrueClass</a></li>
<li><a href="./JSON/Pure/Generator/State.html">JSON::Pure::Generator::State</a></li>
<li><a href="./JSON/Pure/Parser.html">JSON::Pure::Parser</a></li>
<li><a href="./JSON/GeneratorError.html">JSON::UnparserError</a></li>
<li><a href="./BigDecimal.html">BigDecimal</a></li>
<li><a href="./Class.html">Class</a></li>
<li><a href="./Complex.html">Complex</a></li>
<li><a href="./Date.html">Date</a></li>
<li><a href="./DateTime.html">DateTime</a></li>
<li><a href="./Exception.html">Exception</a></li>
<li><a href="./Kernel.html">Kernel</a></li>
<li><a href="./OpenStruct.html">OpenStruct</a></li>
<li><a href="./Range.html">Range</a></li>
<li><a href="./Rational.html">Rational</a></li>
<li><a href="./Regexp.html">Regexp</a></li>
<li><a href="./Struct.html">Struct</a></li>
<li><a href="./Symbol.html">Symbol</a></li>
<li><a href="./Time.html">Time</a></li>
</ul>
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
</div>
</div>
</div>
<div id="documentation">
<h1 class="class">Rational</h1>
<div id="description" class="description">
</div><!-- description -->
<div id="5Buntitled-5D" class="documentation-section">
<!-- Methods -->
<div id="public-class-method-details" class="method-section section">
<h3 class="section-header">Public Class Methods</h3>
<div id="json_create-method" class="method-detail ">
<a name="method-c-json_create"></a>
<div class="method-heading">
<span class="method-name">json_create</span><span
class="method-args">(object)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="json_create-source">
<pre>
<span class="ruby-comment"># File lib/json/add/rational.rb, line 7</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">json_create</span>(<span class="ruby-identifier">object</span>)
<span class="ruby-constant">Rational</span>(<span class="ruby-identifier">object</span>[<span class="ruby-string">'n'</span>], <span class="ruby-identifier">object</span>[<span class="ruby-string">'d'</span>])
<span class="ruby-keyword">end</span></pre>
</div><!-- json_create-source -->
</div>
</div><!-- json_create-method -->
</div><!-- public-class-method-details -->
<div id="public-instance-method-details" class="method-section section">
<h3 class="section-header">Public Instance Methods</h3>
<div id="as_json-method" class="method-detail ">
<a name="method-i-as_json"></a>
<div class="method-heading">
<span class="method-name">as_json</span><span
class="method-args">(*)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="as_json-source">
<pre>
<span class="ruby-comment"># File lib/json/add/rational.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">as_json</span>(*)
{
<span class="ruby-constant">JSON</span>.<span class="ruby-identifier">create_id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>,
<span class="ruby-string">'n'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">numerator</span>,
<span class="ruby-string">'d'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">denominator</span>,
}
<span class="ruby-keyword">end</span></pre>
</div><!-- as_json-source -->
</div>
</div><!-- as_json-method -->
<div id="to_json-method" class="method-detail ">
<a name="method-i-to_json"></a>
<div class="method-heading">
<span class="method-name">to_json</span><span
class="method-args">(*)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="to_json-source">
<pre>
<span class="ruby-comment"># File lib/json/add/rational.rb, line 19</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_json</span>(*)
<span class="ruby-identifier">as_json</span>.<span class="ruby-identifier">to_json</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- to_json-source -->
</div>
</div><!-- to_json-method -->
</div><!-- public-instance-method-details -->
</div><!-- 5Buntitled-5D -->
</div><!-- documentation -->
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
Rdoc Generator</a> 2</small>.</p>
</div>
</body>
</html>