eymiha_units 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. data/gem_package.rb +4 -4
  2. data/html/classes/Eymiha/AmbiguousUnitsException.html +119 -0
  3. data/html/classes/Eymiha/MissingUnitsException.html +119 -0
  4. data/html/classes/Eymiha/NumericWithUnits.html +867 -0
  5. data/html/classes/Eymiha/NumericWithUnits.src/M000021.html +18 -0
  6. data/html/classes/Eymiha/NumericWithUnits.src/M000022.html +18 -0
  7. data/html/classes/Eymiha/NumericWithUnits.src/M000023.html +18 -0
  8. data/html/classes/Eymiha/NumericWithUnits.src/M000024.html +30 -0
  9. data/html/classes/Eymiha/NumericWithUnits.src/M000025.html +30 -0
  10. data/html/classes/Eymiha/NumericWithUnits.src/M000027.html +18 -0
  11. data/html/classes/Eymiha/NumericWithUnits.src/M000028.html +20 -0
  12. data/html/classes/Eymiha/NumericWithUnits.src/M000029.html +32 -0
  13. data/html/classes/Eymiha/NumericWithUnits.src/M000030.html +18 -0
  14. data/html/classes/Eymiha/NumericWithUnits.src/M000031.html +30 -0
  15. data/html/classes/Eymiha/NumericWithUnits.src/M000032.html +30 -0
  16. data/html/classes/Eymiha/NumericWithUnits.src/M000033.html +22 -0
  17. data/html/classes/Eymiha/NumericWithUnits.src/M000034.html +22 -0
  18. data/html/classes/Eymiha/NumericWithUnits.src/M000035.html +32 -0
  19. data/html/classes/Eymiha/NumericWithUnits.src/M000036.html +32 -0
  20. data/html/classes/Eymiha/NumericWithUnits.src/M000037.html +18 -0
  21. data/html/classes/Eymiha/NumericWithUnits.src/M000038.html +18 -0
  22. data/html/classes/Eymiha/NumericWithUnits.src/M000039.html +24 -0
  23. data/html/classes/Eymiha/NumericWithUnits.src/M000040.html +26 -0
  24. data/html/classes/Eymiha/NumericWithUnits.src/M000041.html +18 -0
  25. data/html/classes/Eymiha/NumericWithUnits.src/M000042.html +18 -0
  26. data/html/classes/Eymiha/NumericWithUnits.src/M000043.html +18 -0
  27. data/html/classes/Eymiha/NumericWithUnits.src/M000044.html +20 -0
  28. data/html/classes/Eymiha/NumericWithUnits.src/M000045.html +18 -0
  29. data/html/classes/Eymiha/NumericWithUnits.src/M000046.html +25 -0
  30. data/html/classes/Eymiha/NumericWithUnits.src/M000047.html +18 -0
  31. data/html/classes/Eymiha/NumericWithUnits.src/M000048.html +19 -0
  32. data/html/classes/Eymiha/Units.html +378 -0
  33. data/html/classes/Eymiha/Units.src/M000052.html +18 -0
  34. data/html/classes/Eymiha/Units.src/M000053.html +18 -0
  35. data/html/classes/Eymiha/Units.src/M000054.html +20 -0
  36. data/html/classes/Eymiha/Units.src/M000055.html +30 -0
  37. data/html/classes/Eymiha/Units.src/M000056.html +33 -0
  38. data/html/classes/Eymiha/Units.src/M000057.html +18 -0
  39. data/html/classes/Eymiha/Units.src/M000058.html +21 -0
  40. data/html/classes/Eymiha/Units.src/M000059.html +18 -0
  41. data/html/classes/Eymiha/Units.src/M000060.html +18 -0
  42. data/html/classes/Eymiha/Units.src/M000061.html +18 -0
  43. data/html/classes/Eymiha/Units.src/M000062.html +18 -0
  44. data/html/classes/Eymiha/Units.src/M000063.html +18 -0
  45. data/html/classes/Eymiha/Units.src/M000064.html +28 -0
  46. data/html/classes/Eymiha/UnitsException.html +119 -0
  47. data/html/classes/Eymiha/UnitsHash.html +351 -0
  48. data/html/classes/Eymiha/UnitsHash.src/M000002.html +18 -0
  49. data/html/classes/Eymiha/UnitsHash.src/M000003.html +26 -0
  50. data/html/classes/Eymiha/UnitsHash.src/M000004.html +25 -0
  51. data/html/classes/Eymiha/UnitsHash.src/M000005.html +18 -0
  52. data/html/classes/Eymiha/UnitsHash.src/M000006.html +18 -0
  53. data/html/classes/Eymiha/UnitsHash.src/M000007.html +18 -0
  54. data/html/classes/Eymiha/UnitsHash.src/M000008.html +22 -0
  55. data/html/classes/Eymiha/UnitsHash.src/M000010.html +21 -0
  56. data/html/classes/Eymiha/UnitsHash.src/M000011.html +19 -0
  57. data/html/classes/Eymiha/UnitsHash.src/M000012.html +27 -0
  58. data/html/classes/Eymiha/UnitsHash.src/M000013.html +18 -0
  59. data/html/classes/Eymiha/UnitsMeasure.html +302 -0
  60. data/html/classes/Eymiha/UnitsMeasure.src/M000014.html +23 -0
  61. data/html/classes/Eymiha/UnitsMeasure.src/M000015.html +18 -0
  62. data/html/classes/Eymiha/UnitsMeasure.src/M000016.html +18 -0
  63. data/html/classes/Eymiha/UnitsMeasure.src/M000017.html +18 -0
  64. data/html/classes/Eymiha/UnitsMeasure.src/M000018.html +18 -0
  65. data/html/classes/Eymiha/UnitsMeasure.src/M000019.html +18 -0
  66. data/html/classes/Eymiha/UnitsMeasure.src/M000020.html +18 -0
  67. data/html/classes/Eymiha/UnitsSystem.html +196 -0
  68. data/html/classes/Eymiha/UnitsSystem.src/M000050.html +31 -0
  69. data/html/classes/Eymiha/UnitsSystem.src/M000051.html +18 -0
  70. data/html/classes/Eymiha/UnitsUnit.html +166 -0
  71. data/html/classes/Eymiha/UnitsUnit.src/M000049.html +18 -0
  72. data/html/classes/Eymiha.html +143 -0
  73. data/html/classes/Numeric.html +182 -0
  74. data/html/classes/Numeric.src/M000001.html +50 -0
  75. data/html/created.rid +1 -0
  76. data/html/files/lib/eymiha/units/definitions/area_rb.html +101 -0
  77. data/html/files/lib/eymiha/units/definitions/length_rb.html +101 -0
  78. data/html/files/lib/eymiha/units/definitions/mass_rb.html +101 -0
  79. data/html/files/lib/eymiha/units/definitions/measures_rb.html +113 -0
  80. data/html/files/lib/eymiha/units/definitions/time_rb.html +101 -0
  81. data/html/files/lib/eymiha/units/definitions/velocity_rb.html +101 -0
  82. data/html/files/lib/eymiha/units/definitions/volume_rb.html +101 -0
  83. data/html/files/lib/eymiha/units/numeric_rb.html +116 -0
  84. data/html/files/lib/eymiha/units/numeric_with_units_rb.html +109 -0
  85. data/html/files/lib/eymiha/units/object_rb.html +108 -0
  86. data/html/files/lib/eymiha/units/units_exception_rb.html +101 -0
  87. data/html/files/lib/eymiha/units/units_hash_rb.html +108 -0
  88. data/html/files/lib/eymiha/units/units_measure_rb.html +109 -0
  89. data/html/files/lib/eymiha/units/units_rb.html +115 -0
  90. data/html/files/lib/eymiha/units/units_system_rb.html +109 -0
  91. data/html/files/lib/eymiha/units/units_unit_rb.html +109 -0
  92. data/html/files/lib/eymiha/units_rb.html +115 -0
  93. data/html/fr_class_index.html +37 -0
  94. data/html/fr_file_index.html +43 -0
  95. data/html/fr_method_index.html +90 -0
  96. data/html/index.html +24 -0
  97. data/html/rdoc-style.css +208 -0
  98. data/lib/{units → eymiha/units}/definitions/area.rb +0 -0
  99. data/lib/{units → eymiha/units}/definitions/length.rb +0 -0
  100. data/lib/{units → eymiha/units}/definitions/mass.rb +0 -0
  101. data/lib/eymiha/units/definitions/measures.rb +6 -0
  102. data/lib/{units → eymiha/units}/definitions/time.rb +0 -0
  103. data/lib/{units → eymiha/units}/definitions/velocity.rb +0 -0
  104. data/lib/{units → eymiha/units}/definitions/volume.rb +0 -0
  105. data/lib/{units → eymiha/units}/numeric.rb +4 -3
  106. data/lib/eymiha/units/numeric_with_units.rb +640 -0
  107. data/lib/{units → eymiha/units}/object.rb +1 -1
  108. data/lib/eymiha/units/units.rb +234 -0
  109. data/lib/eymiha/units/units_exception.rb +18 -0
  110. data/lib/eymiha/units/units_hash.rb +118 -0
  111. data/lib/eymiha/units/units_measure.rb +95 -0
  112. data/lib/eymiha/units/units_system.rb +89 -0
  113. data/lib/eymiha/units/units_unit.rb +63 -0
  114. data/lib/eymiha/units.rb +4 -0
  115. data/test/tc_definitions.rb +1 -1
  116. data/test/tc_formatting.rb +2 -2
  117. data/test/tc_formatting_derived.rb +2 -2
  118. data/test/tc_measure_create.rb +2 -2
  119. data/test/tc_measure_derive.rb +2 -2
  120. data/test/tc_system_create.rb +2 -2
  121. data/test/tc_unit_ambiguity.rb +2 -2
  122. data/test/tc_unit_arithmetic.rb +2 -2
  123. data/test/tc_unit_create.rb +2 -2
  124. data/test/tc_unit_derive.rb +2 -2
  125. data/test/tc_unit_equality.rb +2 -2
  126. data/test/tc_unit_forward_reference.rb +2 -2
  127. data/test/tc_unit_greek.rb +2 -2
  128. data/test/tc_unit_hash.rb +2 -2
  129. data/test/tc_unit_identifiers.rb +2 -2
  130. data/test/tc_unit_rank.rb +2 -2
  131. data/test/tc_uses_1.rb +2 -2
  132. data/test/tc_uses_2.rb +2 -2
  133. metadata +190 -86
  134. data/lib/units/definitions/measures.rb +0 -6
  135. data/lib/units/numeric_with_units.rb +0 -635
  136. data/lib/units/units.rb +0 -229
  137. data/lib/units/units_exception.rb +0 -14
  138. data/lib/units/units_hash.rb +0 -112
  139. data/lib/units/units_measure.rb +0 -91
  140. data/lib/units/units_system.rb +0 -85
  141. data/lib/units/units_unit.rb +0 -60
  142. data/lib/units.rb +0 -4
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>clear (Eymiha::Units)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/eymiha/units/units.rb, line 92</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Units</span>.<span class="ruby-identifier">clear</span>
15
+ <span class="ruby-ivar">@@measures</span>.<span class="ruby-identifier">clear</span>
16
+ <span class="ruby-ivar">@@units</span>.<span class="ruby-identifier">clear</span>
17
+ <span class="ruby-identifier">forward_references_clear</span>
18
+ <span class="ruby-keyword kw">self</span>
19
+ <span class="ruby-keyword kw">end</span></pre>
20
+ </body>
21
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>size (Eymiha::Units)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/eymiha/units/units.rb, line 100</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Units</span>.<span class="ruby-identifier">size</span>
15
+ <span class="ruby-ivar">@@measures</span>.<span class="ruby-identifier">size</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>[] (Eymiha::Units)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/eymiha/units/units.rb, line 105</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Units</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">name</span>)
15
+ <span class="ruby-ivar">@@measures</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>]
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>names_of (Eymiha::Units)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/eymiha/units/units.rb, line 116</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Units</span>.<span class="ruby-identifier">names_of</span>(<span class="ruby-identifier">units_measure</span>)
15
+ <span class="ruby-ivar">@@measures</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@@measures</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">equal?</span> <span class="ruby-identifier">units_measure</span> }
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>lookup (Eymiha::Units)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/eymiha/units/units.rb, line 136</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Units</span>.<span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">unit_identifier</span>)
15
+ <span class="ruby-ivar">@@units</span>[<span class="ruby-identifier">unit_identifier</span>.<span class="ruby-identifier">to_s</span>] <span class="ruby-operator">||</span> [ ]
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>defining? (Eymiha::Units)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/eymiha/units/units.rb, line 142</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Units</span>.<span class="ruby-identifier">defining?</span>
15
+ <span class="ruby-ivar">@@defining</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>rank (Eymiha::Units)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/eymiha/units/units.rb, line 218</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Units</span>.<span class="ruby-identifier">rank</span>(<span class="ruby-identifier">unit_choices</span> = {},<span class="ruby-identifier">samples</span> = [],<span class="ruby-operator">&amp;</span><span class="ruby-identifier">numeric_ranker</span>) <span class="ruby-comment cmt"># :yields: n</span>
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
16
+ <span class="ruby-identifier">scores</span> = {}
17
+ <span class="ruby-identifier">samples</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
18
+ <span class="ruby-identifier">unit_choices</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">uc</span>,<span class="ruby-identifier">w</span><span class="ruby-operator">|</span>
19
+ <span class="ruby-identifier">scores</span>[<span class="ruby-identifier">uc</span>] = (<span class="ruby-identifier">scores</span>[<span class="ruby-identifier">uc</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">w</span><span class="ruby-operator">*</span>(<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">convert</span>(<span class="ruby-identifier">uc</span>).<span class="ruby-identifier">numeric</span>) } }
20
+ <span class="ruby-identifier">scores</span>.<span class="ruby-identifier">sort</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e1</span>,<span class="ruby-identifier">e2</span><span class="ruby-operator">|</span> <span class="ruby-operator">-</span>(<span class="ruby-identifier">e1</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">e2</span>[<span class="ruby-value">1</span>])}.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>[<span class="ruby-value">0</span>]}
21
+ <span class="ruby-keyword kw">else</span>
22
+ <span class="ruby-identifier">rank</span>(<span class="ruby-identifier">unit_choices</span>,<span class="ruby-identifier">samples</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span>
23
+ <span class="ruby-identifier">e</span> = ((((<span class="ruby-identifier">n</span>.<span class="ruby-identifier">abs</span>)<span class="ruby-operator">-</span><span class="ruby-value">5.5</span>).<span class="ruby-identifier">abs</span><span class="ruby-operator">-</span><span class="ruby-value">4.5</span>).<span class="ruby-identifier">at_least</span>(<span class="ruby-value">0</span>))
24
+ (<span class="ruby-identifier">e</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>) <span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">e</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>)<span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-operator">-</span>(<span class="ruby-identifier">e</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span><span class="ruby-operator">/</span>(<span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">e</span>)) }
25
+ <span class="ruby-keyword kw">end</span>
26
+ <span class="ruby-keyword kw">end</span></pre>
27
+ </body>
28
+ </html>
@@ -0,0 +1,119 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Eymiha::UnitsException</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Eymiha::UnitsException</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/eymiha/units/units_exception_rb.html">
59
+ lib/eymiha/units/units_exception.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Exception
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ Raised when a general problem has occurred in the <a
84
+ href="Units.html">Units</a> framework or some other error has occurred
85
+ during its use.
86
+ </p>
87
+
88
+ </div>
89
+
90
+
91
+ </div>
92
+
93
+
94
+ </div>
95
+
96
+
97
+ <!-- if includes -->
98
+
99
+ <div id="section">
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ <!-- if method_list -->
109
+
110
+
111
+ </div>
112
+
113
+
114
+ <div id="validator-badges">
115
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
116
+ </div>
117
+
118
+ </body>
119
+ </html>
@@ -0,0 +1,351 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Eymiha::UnitsHash</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Eymiha::UnitsHash</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/eymiha/units/units_hash_rb.html">
59
+ lib/eymiha/units/units_hash.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Hash
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ The unit part of a <a href="NumericWithUnits.html">NumericWithUnits</a> is
84
+ a <a href="UnitsHash.html">UnitsHash</a> - a Hash from <a
85
+ href="UnitsUnit.html">UnitsUnit</a> instances to powers.
86
+ </p>
87
+
88
+ </div>
89
+
90
+
91
+ </div>
92
+
93
+ <div id="method-list">
94
+ <h3 class="section-bar">Methods</h3>
95
+
96
+ <div class="name-list">
97
+ <a href="#M000009">*</a>&nbsp;&nbsp;
98
+ <a href="#M000006">**</a>&nbsp;&nbsp;
99
+ <a href="#M000002">debug=</a>&nbsp;&nbsp;
100
+ <a href="#M000011">derived?</a>&nbsp;&nbsp;
101
+ <a href="#M000013">has_units?</a>&nbsp;&nbsp;
102
+ <a href="#M000010">measure</a>&nbsp;&nbsp;
103
+ <a href="#M000007">merge</a>&nbsp;&nbsp;
104
+ <a href="#M000008">merge!</a>&nbsp;&nbsp;
105
+ <a href="#M000003">new</a>&nbsp;&nbsp;
106
+ <a href="#M000005">power!</a>&nbsp;&nbsp;
107
+ <a href="#M000012">reduce</a>&nbsp;&nbsp;
108
+ <a href="#M000004">to_s</a>&nbsp;&nbsp;
109
+ </div>
110
+ </div>
111
+
112
+ </div>
113
+
114
+
115
+ <!-- if includes -->
116
+
117
+ <div id="section">
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+ <!-- if method_list -->
127
+ <div id="methods">
128
+ <h3 class="section-bar">Public Class methods</h3>
129
+
130
+ <div id="method-M000002" class="method-detail">
131
+ <a name="M000002"></a>
132
+
133
+ <div class="method-heading">
134
+ <a href="UnitsHash.src/M000002.html" target="Code" class="method-signature"
135
+ onclick="popupCode('UnitsHash.src/M000002.html');return false;">
136
+ <span class="method-name">debug=</span><span class="method-args">(value)</span>
137
+ </a>
138
+ </div>
139
+
140
+ <div class="method-description">
141
+ </div>
142
+ </div>
143
+
144
+ <div id="method-M000003" class="method-detail">
145
+ <a name="M000003"></a>
146
+
147
+ <div class="method-heading">
148
+ <a href="UnitsHash.src/M000003.html" target="Code" class="method-signature"
149
+ onclick="popupCode('UnitsHash.src/M000003.html');return false;">
150
+ <span class="method-name">new</span><span class="method-args">(unit = nil,power = 1)</span>
151
+ </a>
152
+ </div>
153
+
154
+ <div class="method-description">
155
+ </div>
156
+ </div>
157
+
158
+ <h3 class="section-bar">Public Instance methods</h3>
159
+
160
+ <div id="method-M000009" class="method-detail">
161
+ <a name="M000009"></a>
162
+
163
+ <div class="method-heading">
164
+ <span class="method-name">*</span><span class="method-args">(value,power=1)</span>
165
+ </div>
166
+
167
+ <div class="method-description">
168
+ <p>
169
+ Alias for <a href="UnitsHash.html#M000007">merge</a>
170
+ </p>
171
+ </div>
172
+ </div>
173
+
174
+ <div id="method-M000006" class="method-detail">
175
+ <a name="M000006"></a>
176
+
177
+ <div class="method-heading">
178
+ <a href="UnitsHash.src/M000006.html" target="Code" class="method-signature"
179
+ onclick="popupCode('UnitsHash.src/M000006.html');return false;">
180
+ <span class="method-name">**</span><span class="method-args">(power)</span>
181
+ </a>
182
+ </div>
183
+
184
+ <div class="method-description">
185
+ <p>
186
+ Returns a <a href="UnitsHash.html#M000003">new</a> <a
187
+ href="UnitsHash.html">UnitsHash</a> whose value is the instance raised to
188
+ the given power.
189
+ </p>
190
+ </div>
191
+ </div>
192
+
193
+ <div id="method-M000011" class="method-detail">
194
+ <a name="M000011"></a>
195
+
196
+ <div class="method-heading">
197
+ <a href="UnitsHash.src/M000011.html" target="Code" class="method-signature"
198
+ onclick="popupCode('UnitsHash.src/M000011.html');return false;">
199
+ <span class="method-name">derived?</span><span class="method-args">()</span>
200
+ </a>
201
+ </div>
202
+
203
+ <div class="method-description">
204
+ <p>
205
+ Returns true is any of the instance&#8216;s components are derived.
206
+ </p>
207
+ </div>
208
+ </div>
209
+
210
+ <div id="method-M000013" class="method-detail">
211
+ <a name="M000013"></a>
212
+
213
+ <div class="method-heading">
214
+ <a href="UnitsHash.src/M000013.html" target="Code" class="method-signature"
215
+ onclick="popupCode('UnitsHash.src/M000013.html');return false;">
216
+ <span class="method-name">has_units?</span><span class="method-args">()</span>
217
+ </a>
218
+ </div>
219
+
220
+ <div class="method-description">
221
+ <p>
222
+ Return true if the instance is not equal to 1, ie. has at least one
223
+ non-zero exponent.
224
+ </p>
225
+ </div>
226
+ </div>
227
+
228
+ <div id="method-M000010" class="method-detail">
229
+ <a name="M000010"></a>
230
+
231
+ <div class="method-heading">
232
+ <a href="UnitsHash.src/M000010.html" target="Code" class="method-signature"
233
+ onclick="popupCode('UnitsHash.src/M000010.html');return false;">
234
+ <span class="method-name">measure</span><span class="method-args">()</span>
235
+ </a>
236
+ </div>
237
+
238
+ <div class="method-description">
239
+ <p>
240
+ Returns the <a href="UnitsMeasure.html">UnitsMeasure</a> of the instance if
241
+ defined.
242
+ </p>
243
+ </div>
244
+ </div>
245
+
246
+ <div id="method-M000007" class="method-detail">
247
+ <a name="M000007"></a>
248
+
249
+ <div class="method-heading">
250
+ <a href="UnitsHash.src/M000007.html" target="Code" class="method-signature"
251
+ onclick="popupCode('UnitsHash.src/M000007.html');return false;">
252
+ <span class="method-name">merge</span><span class="method-args">(value,power=1)</span>
253
+ </a>
254
+ </div>
255
+
256
+ <div class="method-description">
257
+ <p>
258
+ Returns a <a href="UnitsHash.html#M000003">new</a> <a
259
+ href="UnitsHash.html">UnitsHash</a> whose value is the instance&#8216;s
260
+ units and powers have been merged with the given value raised to the power.
261
+ </p>
262
+ </div>
263
+ </div>
264
+
265
+ <div id="method-M000008" class="method-detail">
266
+ <a name="M000008"></a>
267
+
268
+ <div class="method-heading">
269
+ <a href="UnitsHash.src/M000008.html" target="Code" class="method-signature"
270
+ onclick="popupCode('UnitsHash.src/M000008.html');return false;">
271
+ <span class="method-name">merge!</span><span class="method-args">(value,power=1)</span>
272
+ </a>
273
+ </div>
274
+
275
+ <div class="method-description">
276
+ <p>
277
+ Merges and returns the instance after the value raised to the power has
278
+ been merged into it.
279
+ </p>
280
+ </div>
281
+ </div>
282
+
283
+ <div id="method-M000005" class="method-detail">
284
+ <a name="M000005"></a>
285
+
286
+ <div class="method-heading">
287
+ <a href="UnitsHash.src/M000005.html" target="Code" class="method-signature"
288
+ onclick="popupCode('UnitsHash.src/M000005.html');return false;">
289
+ <span class="method-name">power!</span><span class="method-args">(power)</span>
290
+ </a>
291
+ </div>
292
+
293
+ <div class="method-description">
294
+ <p>
295
+ Raises and returns the instance after each of its exponents has been raised
296
+ by the given power.
297
+ </p>
298
+ </div>
299
+ </div>
300
+
301
+ <div id="method-M000012" class="method-detail">
302
+ <a name="M000012"></a>
303
+
304
+ <div class="method-heading">
305
+ <a href="UnitsHash.src/M000012.html" target="Code" class="method-signature"
306
+ onclick="popupCode('UnitsHash.src/M000012.html');return false;">
307
+ <span class="method-name">reduce</span><span class="method-args">()</span>
308
+ </a>
309
+ </div>
310
+
311
+ <div class="method-description">
312
+ <p>
313
+ Return a <a href="NumericWithUnits.html">NumericWithUnits</a> that
314
+ represents the instance when all derived units have been replaced with the
315
+ units from which they derive.
316
+ </p>
317
+ </div>
318
+ </div>
319
+
320
+ <div id="method-M000004" class="method-detail">
321
+ <a name="M000004"></a>
322
+
323
+ <div class="method-heading">
324
+ <a href="UnitsHash.src/M000004.html" target="Code" class="method-signature"
325
+ onclick="popupCode('UnitsHash.src/M000004.html');return false;">
326
+ <span class="method-name">to_s</span><span class="method-args">(numeric = 1,use_abbrevs = false)</span>
327
+ </a>
328
+ </div>
329
+
330
+ <div class="method-description">
331
+ <p>
332
+ Returns a String reprentation of the instance. If there is only one item in
333
+ the <a href="UnitsHash.html">UnitsHash</a>, whole names are rendered;
334
+ otherwise abbreviations are used.
335
+ </p>
336
+ </div>
337
+ </div>
338
+
339
+
340
+ </div>
341
+
342
+
343
+ </div>
344
+
345
+
346
+ <div id="validator-badges">
347
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
348
+ </div>
349
+
350
+ </body>
351
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>debug= (Eymiha::UnitsHash)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/eymiha/units/units_hash.rb, line 11</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debug=</span>(<span class="ruby-identifier">value</span>)
15
+ <span class="ruby-ivar">@@debug</span> = <span class="ruby-identifier">value</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>