Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 7e5d6f76ee
Fetching contributors…

Cannot retrieve contributors at this time

556 lines (325 sloc) 24.592 kB
<?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: Object</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 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>
</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"><a href="Object.html">Object</a></p>
</div>
<!-- Namespace Contents -->
<!-- Method Quickref -->
<div id="method-list-section" class="section">
<h3 class="section-header">Methods</h3>
<ul class="link-list">
<li><a href="#method-i-addr2str">#addr2str</a></li>
<li><a href="#method-i-decode_framedata">#decode_framedata</a></li>
<li><a href="#method-i-decode_framedata">#decode_framedata</a></li>
<li><a href="#method-i-frame_inspect">#frame_inspect</a></li>
<li><a href="#method-i-str2addr">#str2addr</a></li>
</ul>
</div>
<!-- Included Modules -->
</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.html">README</a></li>
<li class="file"><a href="./license/LICENSE.html">LICENSE</a></li>
<li class="file"><a href="./license/gpl_txt.html">gpl.txt</a></li>
<li class="file"><a href="./license/lgpl_txt.html">lgpl.txt</a></li>
<li class="file"><a href="./monit/monitrc-ansible.html">monitrc-ansible</a></li>
</ul>
</div>
<div id="classindex-section" class="section project-section">
<h3 class="section-header">Class 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="./Ansible.html">Ansible</a></li>
<li><a href="./Ansible/AnsibleCallback.html">Ansible::AnsibleCallback</a></li>
<li><a href="./Ansible/AnsibleValue.html">Ansible::AnsibleValue</a></li>
<li><a href="./Ansible/Device.html">Ansible::Device</a></li>
<li><a href="./Ansible/Dimmer.html">Ansible::Dimmer</a></li>
<li><a href="./Ansible/KNX.html">Ansible::KNX</a></li>
<li><a href="./Ansible/KNX/Canonical_1bit.html">Ansible::KNX::Canonical_1bit</a></li>
<li><a href="./Ansible/KNX/DPT1.html">Ansible::KNX::DPT1</a></li>
<li><a href="./Ansible/KNX/DPT10.html">Ansible::KNX::DPT10</a></li>
<li><a href="./Ansible/KNX/DPT10/DPT10_Frame.html">Ansible::KNX::DPT10::DPT10_Frame</a></li>
<li><a href="./Ansible/KNX/DPT11.html">Ansible::KNX::DPT11</a></li>
<li><a href="./Ansible/KNX/DPT11/DPT11_Frame.html">Ansible::KNX::DPT11::DPT11_Frame</a></li>
<li><a href="./Ansible/KNX/DPT12.html">Ansible::KNX::DPT12</a></li>
<li><a href="./Ansible/KNX/DPT12/DPT12_Frame.html">Ansible::KNX::DPT12::DPT12_Frame</a></li>
<li><a href="./Ansible/KNX/DPT13.html">Ansible::KNX::DPT13</a></li>
<li><a href="./Ansible/KNX/DPT13/DPT13_Frame.html">Ansible::KNX::DPT13::DPT13_Frame</a></li>
<li><a href="./Ansible/KNX/DPT14.html">Ansible::KNX::DPT14</a></li>
<li><a href="./Ansible/KNX/DPT14/DPT14_Float.html">Ansible::KNX::DPT14::DPT14_Float</a></li>
<li><a href="./Ansible/KNX/DPT14/DPT14_Frame.html">Ansible::KNX::DPT14::DPT14_Frame</a></li>
<li><a href="./Ansible/KNX/DPT15.html">Ansible::KNX::DPT15</a></li>
<li><a href="./Ansible/KNX/DPT15/DPT15_Frame.html">Ansible::KNX::DPT15::DPT15_Frame</a></li>
<li><a href="./Ansible/KNX/DPT16.html">Ansible::KNX::DPT16</a></li>
<li><a href="./Ansible/KNX/DPT16/DPT16_Frame.html">Ansible::KNX::DPT16::DPT16_Frame</a></li>
<li><a href="./Ansible/KNX/DPT17.html">Ansible::KNX::DPT17</a></li>
<li><a href="./Ansible/KNX/DPT17/DPT17_Frame.html">Ansible::KNX::DPT17::DPT17_Frame</a></li>
<li><a href="./Ansible/KNX/DPT18.html">Ansible::KNX::DPT18</a></li>
<li><a href="./Ansible/KNX/DPT18/DPT18_Frame.html">Ansible::KNX::DPT18::DPT18_Frame</a></li>
<li><a href="./Ansible/KNX/DPT19.html">Ansible::KNX::DPT19</a></li>
<li><a href="./Ansible/KNX/DPT19/DPT19_Frame.html">Ansible::KNX::DPT19::DPT19_Frame</a></li>
<li><a href="./Ansible/KNX/DPT1/DPT1_Frame.html">Ansible::KNX::DPT1::DPT1_Frame</a></li>
<li><a href="./Ansible/KNX/DPT2.html">Ansible::KNX::DPT2</a></li>
<li><a href="./Ansible/KNX/DPT2/DPT2_Frame.html">Ansible::KNX::DPT2::DPT2_Frame</a></li>
<li><a href="./Ansible/KNX/DPT3.html">Ansible::KNX::DPT3</a></li>
<li><a href="./Ansible/KNX/DPT3/DPT3_Frame.html">Ansible::KNX::DPT3::DPT3_Frame</a></li>
<li><a href="./Ansible/KNX/DPT4.html">Ansible::KNX::DPT4</a></li>
<li><a href="./Ansible/KNX/DPT4/DPT4_Frame.html">Ansible::KNX::DPT4::DPT4_Frame</a></li>
<li><a href="./Ansible/KNX/DPT5.html">Ansible::KNX::DPT5</a></li>
<li><a href="./Ansible/KNX/DPT5/DPT5_Frame.html">Ansible::KNX::DPT5::DPT5_Frame</a></li>
<li><a href="./Ansible/KNX/DPT6.html">Ansible::KNX::DPT6</a></li>
<li><a href="./Ansible/KNX/DPT6/DPT6_Frame.html">Ansible::KNX::DPT6::DPT6_Frame</a></li>
<li><a href="./Ansible/KNX/DPT7.html">Ansible::KNX::DPT7</a></li>
<li><a href="./Ansible/KNX/DPT7/DPT7_Frame.html">Ansible::KNX::DPT7::DPT7_Frame</a></li>
<li><a href="./Ansible/KNX/DPT8.html">Ansible::KNX::DPT8</a></li>
<li><a href="./Ansible/KNX/DPT8/DPT8_Frame.html">Ansible::KNX::DPT8::DPT8_Frame</a></li>
<li><a href="./Ansible/KNX/DPT9.html">Ansible::KNX::DPT9</a></li>
<li><a href="./Ansible/KNX/DPT9/DPT9_Float.html">Ansible::KNX::DPT9::DPT9_Float</a></li>
<li><a href="./Ansible/KNX/DPT9/DPT9_Frame.html">Ansible::KNX::DPT9::DPT9_Frame</a></li>
<li><a href="./Ansible/KNX/DPTFrame.html">Ansible::KNX::DPTFrame</a></li>
<li><a href="./Ansible/KNX/Dimmer.html">Ansible::KNX::Dimmer</a></li>
<li><a href="./Ansible/KNX/EISType.html">Ansible::KNX::EISType</a></li>
<li><a href="./Ansible/KNX/KNXValue.html">Ansible::KNX::KNXValue</a></li>
<li><a href="./Ansible/KNX/KNX_Transceiver.html">Ansible::KNX::KNX_Transceiver</a></li>
<li><a href="./Ansible/KNX/KNX_Transceiver/NormalExit.html">Ansible::KNX::KNX_Transceiver::NormalExit</a></li>
<li><a href="./Ansible/KNX/L_DATA_Frame.html">Ansible::KNX::L_DATA_Frame</a></li>
<li><a href="./Ansible/KNX/ScalarValue.html">Ansible::KNX::ScalarValue</a></li>
<li><a href="./Ansible/KNX/Scene.html">Ansible::KNX::Scene</a></li>
<li><a href="./Ansible/KNX/TP_ControlField.html">Ansible::KNX::TP_ControlField</a></li>
<li><a href="./Ansible/PLC.html">Ansible::PLC</a></li>
<li><a href="./Ansible/Switch.html">Ansible::Switch</a></li>
<li><a href="./Ansible/Transceiver.html">Ansible::Transceiver</a></li>
<li><a href="./Ansible/ZWave.html">Ansible::ZWave</a></li>
<li><a href="./Ansible/ZWave/Dimmer.html">Ansible::ZWave::Dimmer</a></li>
<li><a href="./Ansible/ZWave/ValueID.html">Ansible::ZWave::ValueID</a></li>
<li><a href="./Ansible/ZWave/ValueType_Bool.html">Ansible::ZWave::ValueType_Bool</a></li>
<li><a href="./Ansible/ZWave/ValueType_Button.html">Ansible::ZWave::ValueType_Button</a></li>
<li><a href="./Ansible/ZWave/ValueType_Byte.html">Ansible::ZWave::ValueType_Byte</a></li>
<li><a href="./Ansible/ZWave/ValueType_Decimal.html">Ansible::ZWave::ValueType_Decimal</a></li>
<li><a href="./Ansible/ZWave/ValueType_Int.html">Ansible::ZWave::ValueType_Int</a></li>
<li><a href="./Ansible/ZWave/ValueType_List.html">Ansible::ZWave::ValueType_List</a></li>
<li><a href="./Ansible/ZWave/ValueType_Short.html">Ansible::ZWave::ValueType_Short</a></li>
<li><a href="./Ansible/ZWave/ValueType_String.html">Ansible::ZWave::ValueType_String</a></li>
<li><a href="./Ansible/ZWave/ZWave_Transceiver.html">Ansible::ZWave::ZWave_Transceiver</a></li>
<li><a href="./AutoReload.html">AutoReload</a></li>
<li><a href="./DPT10.html">DPT10</a></li>
<li><a href="./DPT9.html">DPT9</a></li>
<li><a href="./DPT9_Float.html">DPT9_Float</a></li>
<li><a href="./EIBAddr.html">EIBAddr</a></li>
<li><a href="./EIBBuffer.html">EIBBuffer</a></li>
<li><a href="./EIBConnection.html">EIBConnection</a></li>
<li><a href="./EIBInt16.html">EIBInt16</a></li>
<li><a href="./EIBInt32.html">EIBInt32</a></li>
<li><a href="./EIBInt8.html">EIBInt8</a></li>
<li><a href="./OZW_ValueID_id.html">OZW_ValueID_id</a></li>
<li><a href="./OZW_ValueID_id1.html">OZW_ValueID_id1</a></li>
<li><a href="./Object.html">Object</a></li>
<li><a href="./OpenZWave.html">OpenZWave</a></li>
<li><a href="./OrbiterProxy.html">OrbiterProxy</a></li>
<li><a href="./String.html">String</a></li>
<li><a href="./Test.html">Test</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">Object</h1>
<div id="description">
</div>
<!-- Constants -->
<!-- Attributes -->
<!-- Methods -->
<div id="public-instance-method-details" class="method-section section">
<h3 class="section-header">Public Instance Methods</h3>
<div id="addr-str-method" class="method-detail ">
<a name="method-i-addr2str"></a>
<div class="method-heading">
<span class="method-name">addr2str</span><span
class="method-args">(a, ga=false)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>
addr2str: Convert an integer to an EIB address string, in the form
&#8220;1/2/3&#8220; or &#8220;1.2.3&#8220;
</p>
<div class="method-source-code"
id="addr-str-source">
<pre>
<span class="ruby-comment cmt"># File knx/knx_tools.rb, line 28</span>
28: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">addr2str</span>(<span class="ruby-identifier">a</span>, <span class="ruby-identifier">ga</span>=<span class="ruby-keyword kw">false</span>)
29: <span class="ruby-identifier">str</span>=<span class="ruby-value str">&quot;&quot;</span>
30: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">is_a?</span><span class="ruby-constant">Array</span> <span class="ruby-keyword kw">then</span>
31: <span class="ruby-comment cmt">#~ a = a[0]*256+a[1]</span>
32: <span class="ruby-identifier">a</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'c*'</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'n'</span>)[<span class="ruby-value">0</span>]
33: <span class="ruby-keyword kw">end</span>
34: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">ga</span>)
35: <span class="ruby-identifier">str</span> = <span class="ruby-node">&quot;#{(a &gt;&gt; 11) &amp; 0xf}/#{(a &gt;&gt; 8) &amp; 0x7}/#{a &amp; 0xff}&quot;</span>
36: <span class="ruby-keyword kw">else</span>
37: <span class="ruby-identifier">str</span> = <span class="ruby-node">&quot;#{a &gt;&gt; 12}.#{(a &gt;&gt; 8) &amp; 0xf}.#{a &amp; 0xff}&quot;</span>
38: <span class="ruby-keyword kw">end</span>
39: <span class="ruby-keyword kw">return</span>(<span class="ruby-identifier">str</span>)
40: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="decode-framedata-method" class="method-detail ">
<a name="method-i-decode_framedata"></a>
<div class="method-heading">
<span class="method-name">decode_framedata</span><span
class="method-args">(data)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="decode-framedata-source">
<pre>
<span class="ruby-comment cmt"># File knx/knx_tools.rb, line 57</span>
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decode_framedata</span>(<span class="ruby-identifier">data</span>)
58: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">data</span>
59: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Fixnum</span> <span class="ruby-keyword kw">then</span> <span class="ruby-value str">&quot;0x&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">data</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">upcase</span>
60: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Array</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-value str">&quot;0x&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">b</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">upcase</span>}
61: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'C*'</span>).<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-value str">&quot;0x&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">b</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">upcase</span>}
62: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">data</span>
63: <span class="ruby-keyword kw">end</span>
64: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="decode-framedata-method" class="method-detail ">
<a name="method-i-decode_framedata"></a>
<div class="method-heading">
<span class="method-name">decode_framedata</span><span
class="method-args">(data)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="decode-framedata-source">
<pre>
<span class="ruby-comment cmt"># File test5.rb, line 35</span>
35: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decode_framedata</span>(<span class="ruby-identifier">data</span>)
36: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">data</span>
37: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Fixnum</span> <span class="ruby-keyword kw">then</span> <span class="ruby-value str">&quot;0x&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">data</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">upcase</span>
38: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Array</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-value str">&quot;0x&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">b</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">upcase</span>}
39: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'C*'</span>).<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-value str">&quot;0x&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">b</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">upcase</span>}
40: <span class="ruby-keyword kw">end</span>
41: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="frame-inspect-method" class="method-detail ">
<a name="method-i-frame_inspect"></a>
<div class="method-heading">
<span class="method-name">frame_inspect</span><span
class="method-args">(frame)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="frame-inspect-source">
<pre>
<span class="ruby-comment cmt"># File knx/knx_tools.rb, line 66</span>
66: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">frame_inspect</span>(<span class="ruby-identifier">frame</span>)
67: <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;#{Time.now.strftime('%a %d/%m/%Y %H:%M:%S %Z')}: #{Ansible::KNX::APCICODES[frame.apci]}&quot;</span> <span class="ruby-operator">+</span>
68: <span class="ruby-node">&quot; prio=#{Ansible::KNX::PRIOCLASSES[frame.prio_class]}&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot; len=#{frame.datalength}&quot;</span> <span class="ruby-operator">+</span>
69: <span class="ruby-node">&quot; from #{addr2str(frame.src_addr)} to #{addr2str(frame.dst_addr, frame.daf)}&quot;</span> <span class="ruby-operator">+</span>
70: <span class="ruby-value str">&quot; data=&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">decode_framedata</span>(<span class="ruby-identifier">frame</span>.<span class="ruby-identifier">datalength</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">data</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">apci_data</span>).<span class="ruby-identifier">inspect</span>
71: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="str-addr-method" class="method-detail ">
<a name="method-i-str2addr"></a>
<div class="method-heading">
<span class="method-name">str2addr</span><span
class="method-args">(s)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>
str2addr: Parse an address string into an unsigned 16-bit integer
</p>
<div class="method-source-code"
id="str-addr-source">
<pre>
<span class="ruby-comment cmt"># File knx/knx_tools.rb, line 43</span>
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">str2addr</span>(<span class="ruby-identifier">s</span>)
44: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">m</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/(\d*)\/(\d*)\/(\d*)/</span>)
45: <span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span>, <span class="ruby-identifier">c</span> = <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>].<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">m</span>[<span class="ruby-value">3</span>].<span class="ruby-identifier">to_i</span>
46: <span class="ruby-keyword kw">return</span> ((<span class="ruby-identifier">a</span> &amp; <span class="ruby-value">0x01f</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">11</span>) <span class="ruby-operator">|</span> ((<span class="ruby-identifier">b</span> &amp; <span class="ruby-value">0x07</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">8</span>) <span class="ruby-operator">|</span> ((<span class="ruby-identifier">c</span> &amp; <span class="ruby-value">0xff</span>))
47: <span class="ruby-keyword kw">end</span>
48: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">m</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/(\d*)\/(\d*)/</span>)
49: <span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span> = <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>].<span class="ruby-identifier">to_i</span>
50: <span class="ruby-keyword kw">return</span> ((<span class="ruby-identifier">a</span> &amp; <span class="ruby-value">0x01f</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">11</span>) <span class="ruby-operator">|</span> ((<span class="ruby-identifier">b</span> &amp; <span class="ruby-value">0x7FF</span>))
51: <span class="ruby-keyword kw">end</span>
52: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-value str">&quot;0x&quot;</span>)
53: <span class="ruby-keyword kw">return</span> (<span class="ruby-identifier">s</span>.<span class="ruby-identifier">to_i</span> &amp; <span class="ruby-value">0xffff</span>)
54: <span class="ruby-keyword kw">end</span>
55: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
</div>
</div>
<div id="rdoc-debugging-section-dump" class="debugging-section">
<p>Disabled; run with --debug to generate this.</p>
</div>
<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> 1.1.6</small>.</p>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.