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,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::NumericWithUnits)</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/numeric_with_units.rb, line 28</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>
@@ -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>new (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 41</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">numeric</span>,<span class="ruby-identifier">unit</span>,<span class="ruby-identifier">power</span>=<span class="ruby-value">1</span>)
15
+ <span class="ruby-ivar">@numeric</span>, <span class="ruby-ivar">@unit</span> = <span class="ruby-identifier">numeric</span>, <span class="ruby-identifier">units_hash</span>(<span class="ruby-identifier">unit</span>)<span class="ruby-operator">**</span><span class="ruby-identifier">power</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>to_s (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 61</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>(<span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-identifier">format</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">?</span> <span class="ruby-node">&quot;#{numeric} #{unit.to_s(numeric)}&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">format</span>(<span class="ruby-identifier">format</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,30 @@
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>&lt;=&gt; (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 78</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;=&gt;</span>(<span class="ruby-identifier">value</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">derived?</span>
16
+ <span class="ruby-identifier">reduce</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">value</span>
17
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">NumericWithUnits</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">derived?</span>
19
+ <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">reduce</span>
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-identifier">align</span>(<span class="ruby-identifier">value</span>).<span class="ruby-identifier">numeric</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">numeric</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>
24
+ <span class="ruby-identifier">numeric</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">value</span>
25
+ <span class="ruby-keyword kw">else</span>
26
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnitsException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;units mismatch&quot;</span>)
27
+ <span class="ruby-keyword kw">end</span>
28
+ <span class="ruby-keyword kw">end</span></pre>
29
+ </body>
30
+ </html>
@@ -0,0 +1,30 @@
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>approximately_equals? (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 100</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">approximately_equals?</span>(<span class="ruby-identifier">value</span>,<span class="ruby-identifier">epsilon</span>=<span class="ruby-constant">Numeric</span>.<span class="ruby-identifier">epsilon</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">derived?</span>
16
+ <span class="ruby-identifier">reduce</span>.<span class="ruby-identifier">approximately_equals?</span>(<span class="ruby-identifier">value</span>,<span class="ruby-identifier">epsilon</span>)
17
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">NumericWithUnits</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">derived?</span>
19
+ <span class="ruby-identifier">approximately_equals?</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">reduce</span>,<span class="ruby-identifier">epsilon</span>)
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-identifier">align</span>(<span class="ruby-identifier">value</span>).<span class="ruby-identifier">numeric</span>.<span class="ruby-identifier">approximately_equals?</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">numeric</span>,<span class="ruby-identifier">epsilon</span>)
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>
24
+ <span class="ruby-identifier">numeric</span>.<span class="ruby-identifier">approximately_equals?</span>(<span class="ruby-identifier">value</span>,<span class="ruby-identifier">epsilon</span>)
25
+ <span class="ruby-keyword kw">else</span>
26
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnitsException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;units mismatch&quot;</span>)
27
+ <span class="ruby-keyword kw">end</span>
28
+ <span class="ruby-keyword kw">end</span></pre>
29
+ </body>
30
+ </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::NumericWithUnits)</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/numeric_with_units.rb, line 119</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">+@</span>
15
+ <span class="ruby-identifier">clone</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,20 @@
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::NumericWithUnits)</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/numeric_with_units.rb, line 124</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">-@</span>
15
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">clone</span>
16
+ <span class="ruby-identifier">value</span>.<span class="ruby-identifier">numeric</span> = <span class="ruby-operator">-</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">numeric</span>)
17
+ <span class="ruby-identifier">value</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,32 @@
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::NumericWithUnits)</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/numeric_with_units.rb, line 137</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">+</span>(<span class="ruby-identifier">value</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">derived?</span>
16
+ <span class="ruby-identifier">reduce</span><span class="ruby-operator">+</span><span class="ruby-identifier">value</span>
17
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">NumericWithUnits</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">derived?</span>
19
+ <span class="ruby-keyword kw">self</span><span class="ruby-operator">+</span><span class="ruby-identifier">value</span>.<span class="ruby-identifier">reduce</span>
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-identifier">aligned_value</span> = <span class="ruby-identifier">align</span>(<span class="ruby-identifier">value</span>)
22
+ <span class="ruby-identifier">aligned_value</span>.<span class="ruby-identifier">numeric</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">numeric</span>
23
+ <span class="ruby-identifier">aligned_value</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>
26
+ <span class="ruby-constant">NumericWithUnits</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">numeric</span><span class="ruby-operator">+</span><span class="ruby-identifier">value</span>,<span class="ruby-identifier">unit</span>)
27
+ <span class="ruby-keyword kw">else</span>
28
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnitsException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;units mismatch&quot;</span>)
29
+ <span class="ruby-keyword kw">end</span>
30
+ <span class="ruby-keyword kw">end</span></pre>
31
+ </body>
32
+ </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::NumericWithUnits)</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/numeric_with_units.rb, line 162</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">-</span>(<span class="ruby-identifier">value</span>)
15
+ <span class="ruby-keyword kw">self</span> <span class="ruby-operator">+</span> (<span class="ruby-operator">-</span><span class="ruby-identifier">value</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,30 @@
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::NumericWithUnits)</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/numeric_with_units.rb, line 174</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">*</span>(<span class="ruby-identifier">value</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">derived?</span>
16
+ <span class="ruby-identifier">reduce</span><span class="ruby-operator">*</span><span class="ruby-identifier">value</span>
17
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">NumericWithUnits</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">derived?</span>
19
+ <span class="ruby-keyword kw">self</span><span class="ruby-operator">*</span><span class="ruby-identifier">value</span>.<span class="ruby-identifier">reduce</span>
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-identifier">extend</span>(<span class="ruby-identifier">value</span>,<span class="ruby-value">1</span>)
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>
24
+ <span class="ruby-constant">NumericWithUnits</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">numeric</span><span class="ruby-operator">*</span><span class="ruby-identifier">value</span>,<span class="ruby-identifier">unit</span>)
25
+ <span class="ruby-keyword kw">else</span>
26
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnitsException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;units mismatch&quot;</span>)
27
+ <span class="ruby-keyword kw">end</span>
28
+ <span class="ruby-keyword kw">end</span></pre>
29
+ </body>
30
+ </html>
@@ -0,0 +1,30 @@
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::NumericWithUnits)</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/numeric_with_units.rb, line 200</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">/</span>(<span class="ruby-identifier">value</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">derived?</span>
16
+ <span class="ruby-identifier">reduce</span><span class="ruby-operator">/</span><span class="ruby-identifier">value</span>
17
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">NumericWithUnits</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">derived?</span>
19
+ <span class="ruby-keyword kw">self</span><span class="ruby-operator">/</span><span class="ruby-identifier">value</span>.<span class="ruby-identifier">reduce</span>
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-identifier">extend</span>(<span class="ruby-identifier">value</span>,<span class="ruby-value">-1</span>)
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>
24
+ <span class="ruby-constant">NumericWithUnits</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">numeric</span><span class="ruby-operator">/</span><span class="ruby-identifier">value</span>,<span class="ruby-identifier">unit</span>)
25
+ <span class="ruby-keyword kw">else</span>
26
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnitsException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;units mismatch&quot;</span>)
27
+ <span class="ruby-keyword kw">end</span>
28
+ <span class="ruby-keyword kw">end</span></pre>
29
+ </body>
30
+ </html>
@@ -0,0 +1,22 @@
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::NumericWithUnits)</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/numeric_with_units.rb, line 222</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">**</span>(<span class="ruby-identifier">value</span>)
15
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">NumericWithUnits</span>)
16
+ <span class="ruby-identifier">extend</span>(<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">value</span>)
17
+ <span class="ruby-keyword kw">else</span>
18
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnitsException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;units mismatch&quot;</span>)
19
+ <span class="ruby-keyword kw">end</span>
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,22 @@
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::NumericWithUnits)</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/numeric_with_units.rb, line 236</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">^</span>(<span class="ruby-identifier">value</span>)
15
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">NumericWithUnits</span>)
16
+ <span class="ruby-constant">NumericWithUnits</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">numeric</span>,<span class="ruby-identifier">unit</span>,<span class="ruby-identifier">value</span>)
17
+ <span class="ruby-keyword kw">else</span>
18
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnitsException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;units mismatch&quot;</span>)
19
+ <span class="ruby-keyword kw">end</span>
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,32 @@
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::NumericWithUnits)</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/numeric_with_units.rb, line 252</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">%</span>(<span class="ruby-identifier">value</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">derived?</span>
16
+ <span class="ruby-identifier">reduce</span><span class="ruby-operator">%</span><span class="ruby-identifier">value</span>
17
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">NumericWithUnits</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">derived?</span>
19
+ <span class="ruby-keyword kw">self</span><span class="ruby-operator">%</span><span class="ruby-identifier">value</span>.<span class="ruby-identifier">reduce</span>
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-identifier">aligned_value</span> = <span class="ruby-identifier">align</span>(<span class="ruby-identifier">value</span>)
22
+ <span class="ruby-identifier">aligned_value</span>.<span class="ruby-identifier">numeric</span> = <span class="ruby-identifier">aligned_value</span>.<span class="ruby-identifier">numeric</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">numeric</span>
23
+ <span class="ruby-identifier">aligned_value</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>
26
+ <span class="ruby-constant">NumericWithUnits</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">numeric</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">value</span>,<span class="ruby-identifier">unit</span>)
27
+ <span class="ruby-keyword kw">else</span>
28
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnitsException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;units mismatch&quot;</span>)
29
+ <span class="ruby-keyword kw">end</span>
30
+ <span class="ruby-keyword kw">end</span></pre>
31
+ </body>
32
+ </html>
@@ -0,0 +1,32 @@
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>inv_mod (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 278</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inv_mod</span>(<span class="ruby-identifier">value</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">derived?</span>
16
+ <span class="ruby-identifier">reduce</span>.<span class="ruby-identifier">inv_mod</span> <span class="ruby-identifier">value</span>
17
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">NumericWithUnits</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">derived?</span>
19
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inv_mod</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">reduce</span>
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-identifier">aligned_value</span> = <span class="ruby-identifier">align</span>(<span class="ruby-identifier">value</span>)
22
+ <span class="ruby-identifier">aligned_value</span>.<span class="ruby-identifier">numeric</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">numeric</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">aligned_value</span>.<span class="ruby-identifier">numeric</span>
23
+ <span class="ruby-identifier">aligned_value</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>
26
+ <span class="ruby-constant">NumericWithUnits</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">numeric</span>,<span class="ruby-identifier">unit</span>)
27
+ <span class="ruby-keyword kw">else</span>
28
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnitsException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;units mismatch&quot;</span>)
29
+ <span class="ruby-keyword kw">end</span>
30
+ <span class="ruby-keyword kw">end</span></pre>
31
+ </body>
32
+ </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>derived_align_type= (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 319</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">derived_align_type=</span>(<span class="ruby-identifier">type</span>)
15
+ <span class="ruby-ivar">@@derived_align_type</span> = <span class="ruby-identifier">type</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>derived_align_type (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 326</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">derived_align_type</span>
15
+ <span class="ruby-ivar">@@derived_align_type</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,24 @@
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>align (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 339</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align</span>(<span class="ruby-identifier">target</span>,<span class="ruby-identifier">all</span>=<span class="ruby-keyword kw">true</span>,<span class="ruby-identifier">type</span>=<span class="ruby-ivar">@@derived_align_type</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
16
+ <span class="ruby-identifier">piece_align</span>(<span class="ruby-identifier">target</span>)
17
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">!</span><span class="ruby-identifier">derived?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">target</span>.<span class="ruby-identifier">derived?</span>
18
+ <span class="ruby-identifier">simple_align</span>(<span class="ruby-identifier">target</span>,<span class="ruby-identifier">all</span>)
19
+ <span class="ruby-keyword kw">else</span>
20
+ <span class="ruby-identifier">power_align</span>(<span class="ruby-identifier">target</span>,<span class="ruby-identifier">all</span>,<span class="ruby-identifier">type</span>)
21
+ <span class="ruby-keyword kw">end</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,26 @@
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>extend (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 470</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extend</span>(<span class="ruby-identifier">units</span>,<span class="ruby-identifier">power</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">units</span>
16
+ <span class="ruby-constant">NumericWithUnits</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">numeric</span><span class="ruby-operator">**</span><span class="ruby-identifier">power</span>,<span class="ruby-identifier">unit</span><span class="ruby-operator">**</span><span class="ruby-identifier">power</span>)
17
+ <span class="ruby-keyword kw">else</span>
18
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">align</span>(<span class="ruby-identifier">units</span>,<span class="ruby-keyword kw">false</span>)
19
+ <span class="ruby-identifier">extended_numeric</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">numeric</span><span class="ruby-operator">*</span>(<span class="ruby-identifier">units</span>.<span class="ruby-identifier">numeric</span><span class="ruby-operator">**</span><span class="ruby-identifier">power</span>)
20
+ <span class="ruby-identifier">extended_unit</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">unit</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">units</span>,<span class="ruby-identifier">power</span>)
21
+ (<span class="ruby-identifier">extended_unit</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>)<span class="ruby-operator">?</span> <span class="ruby-identifier">extended_numeric</span> <span class="ruby-operator">:</span>
22
+ <span class="ruby-constant">NumericWithUnits</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">extended_numeric</span>,<span class="ruby-identifier">extended_unit</span>)
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span></pre>
25
+ </body>
26
+ </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>kind_of? (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 576</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">kind_of?</span>(<span class="ruby-identifier">klass</span>)
15
+ (<span class="ruby-identifier">numeric</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-identifier">klass</span>)<span class="ruby-operator">?</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">old_kind_of?</span>(<span class="ruby-identifier">klass</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>unite (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 584</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unite</span>(<span class="ruby-identifier">target_unit</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">power</span>=<span class="ruby-value">1</span>,<span class="ruby-identifier">measure</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-identifier">numeric</span>.<span class="ruby-identifier">unite</span>(<span class="ruby-identifier">target_unit</span>,<span class="ruby-identifier">power</span>,<span class="ruby-identifier">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>convert (Eymiha::NumericWithUnits)</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/numeric_with_units.rb, line 591</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">target_units</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-identifier">target_units</span> <span class="ruby-value">? </span><span class="ruby-identifier">align</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">unite</span>(<span class="ruby-identifier">target_units</span>),<span class="ruby-keyword kw">false</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">clone</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>