facets 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -1
- data/CHANGES +28 -45
- data/MANIFEST +35 -4
- data/README +3 -14
- data/RELEASE +36 -70
- data/VERSION +1 -1
- data/doc/archive/RELEASE-2.5.0 +83 -0
- data/doc/log/basic_stats/index.html +4 -4
- data/doc/log/changelog.html +509 -2
- data/doc/log/changelog.txt +130 -1522
- data/doc/rdoc/core/classes/Array.html +366 -141
- data/doc/rdoc/core/classes/Binding.html +45 -45
- data/doc/rdoc/core/classes/Class.html +38 -38
- data/doc/rdoc/core/classes/Comparable.html +26 -26
- data/doc/rdoc/core/classes/Enumerable.html +174 -170
- data/doc/rdoc/core/classes/Enumerable/Enumerator.html +130 -0
- data/doc/rdoc/core/classes/Enumerator.html +132 -0
- data/doc/rdoc/core/classes/Exception.html +8 -8
- data/doc/rdoc/core/classes/File.html +58 -58
- data/doc/rdoc/core/classes/FileTest.html +4 -4
- data/doc/rdoc/core/classes/Float.html +8 -8
- data/doc/rdoc/core/classes/Functor.html +12 -12
- data/doc/rdoc/core/classes/Hash.html +447 -263
- data/doc/rdoc/core/classes/Indexable.html +110 -110
- data/doc/rdoc/core/classes/Integer.html +2 -2
- data/doc/rdoc/core/classes/Kernel.html +329 -329
- data/doc/rdoc/core/classes/Lazy/Promise.html +1 -1
- data/doc/rdoc/core/classes/MatchData.html +15 -15
- data/doc/rdoc/core/classes/Module.html +176 -157
- data/doc/rdoc/core/classes/NilClass.html +23 -23
- data/doc/rdoc/core/classes/Numeric.html +27 -27
- data/doc/rdoc/core/classes/Object.html +8 -8
- data/doc/rdoc/core/classes/ObjectSpace.html +5 -5
- data/doc/rdoc/core/classes/Proc.html +22 -22
- data/doc/rdoc/core/classes/Regexp.html +1 -1
- data/doc/rdoc/core/classes/Stackable.html +31 -31
- data/doc/rdoc/core/classes/String.html +332 -291
- data/doc/rdoc/core/classes/Symbol.html +1 -1
- data/doc/rdoc/core/classes/TrueClass.html +8 -8
- data/doc/rdoc/core/classes/UnboundMethod.html +18 -13
- data/doc/rdoc/core/created.rid +1 -1
- data/doc/rdoc/core/files/README.html +7 -29
- data/doc/rdoc/core/files/lib/core/facets/array/product_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/collect_rb.html +10 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/compact_map_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/enumerable/map_with_index_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/enumerable/split_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/collate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/group_by_value_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/new_with_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/module/conflict_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/extend_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/align_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/file_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/string/xor_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/to_hash_rb.html +5 -1
- data/doc/rdoc/core/files/lib/core/facets/unboundmethod/name_rb.html +1 -1
- data/doc/rdoc/core/fr_class_index.html +2 -0
- data/doc/rdoc/core/fr_file_index.html +6 -0
- data/doc/rdoc/core/fr_method_index.html +386 -373
- data/doc/rdoc/lore/classes/OpenStruct.html +6 -4
- data/doc/rdoc/lore/created.rid +1 -1
- data/doc/rdoc/lore/files/README.html +7 -29
- data/doc/rdoc/lore/files/lib/lore/facets/ostruct_rb.html +1 -1
- data/doc/rdoc/more/classes/ANSICode.html +66 -66
- data/doc/rdoc/more/classes/Advisable.html +37 -37
- data/doc/rdoc/more/classes/Advisable/Method.html +20 -20
- data/doc/rdoc/more/classes/Archive/Tar/Minitar.html +27 -27
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Input.html +28 -28
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Output.html +19 -19
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Reader.html +31 -31
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Writer.html +33 -33
- data/doc/rdoc/more/classes/Association.html +67 -53
- data/doc/rdoc/more/classes/Association/Kernel.html +11 -12
- data/doc/rdoc/more/classes/BBCode.html +36 -36
- data/doc/rdoc/more/classes/BaseX.html +16 -16
- data/doc/rdoc/more/classes/BiCrypt.html +67 -67
- data/doc/rdoc/more/classes/BinReadable.html +85 -85
- data/doc/rdoc/more/classes/BinReadable/ByteOrder.html +25 -25
- data/doc/rdoc/more/classes/Binding.html +8 -8
- data/doc/rdoc/more/classes/Buildable.html +4 -4
- data/doc/rdoc/more/classes/Cloneable.html +4 -4
- data/doc/rdoc/more/classes/ConsoleUtils.html +18 -18
- data/doc/rdoc/more/classes/Crypt.html +16 -16
- data/doc/rdoc/more/classes/CssTree.html +8 -8
- data/doc/rdoc/more/classes/Dictionary.html +52 -45
- data/doc/rdoc/more/classes/Enumerable.html +50 -50
- data/doc/rdoc/more/classes/Enumerable/Elementor.html +16 -16
- data/doc/rdoc/more/classes/Enumerable/Enumerator.html +4 -4
- data/doc/rdoc/more/classes/Enumerable/Filterable.html +30 -30
- data/doc/rdoc/more/classes/EnumerablePass.html +15 -15
- data/doc/rdoc/more/classes/Equatable.html +16 -16
- data/doc/rdoc/more/classes/Expirable.html +17 -17
- data/doc/rdoc/more/classes/Fileable.html +14 -14
- data/doc/rdoc/more/classes/Fileable/DSL.html +41 -41
- data/doc/rdoc/more/classes/Hash2Xml.html +4 -4
- data/doc/rdoc/more/classes/Hook.html +162 -0
- data/doc/rdoc/more/classes/HtmlFilter.html +9 -9
- data/doc/rdoc/more/classes/Instantiable.html +9 -9
- data/doc/rdoc/more/classes/Instantize.html +8 -8
- data/doc/rdoc/more/classes/Interval.html +187 -187
- data/doc/rdoc/more/classes/It.html +12 -12
- data/doc/rdoc/more/classes/Matcher.html +38 -38
- data/doc/rdoc/more/classes/Matcher/MatchData.html +4 -4
- data/doc/rdoc/more/classes/Memoizer.html +21 -21
- data/doc/rdoc/more/classes/Multiton.html +12 -12
- data/doc/rdoc/more/classes/Multiton/MetaMethods.html +28 -28
- data/doc/rdoc/more/classes/Net/SMTP.html +8 -8
- data/doc/rdoc/more/classes/OpEsc.html +5 -5
- data/doc/rdoc/more/classes/OpenCascade.html +4 -4
- data/doc/rdoc/more/classes/OpenHash.html +9 -9
- data/doc/rdoc/more/classes/OpenStructable.html +36 -36
- data/doc/rdoc/more/classes/PQueue.html +84 -84
- data/doc/rdoc/more/classes/Paramix.html +16 -16
- data/doc/rdoc/more/classes/Paramix/Delegator.html +16 -16
- data/doc/rdoc/more/classes/RWDelegator.html +16 -16
- data/doc/rdoc/more/classes/Random.html +5 -5
- data/doc/rdoc/more/classes/Random/Array.html +37 -37
- data/doc/rdoc/more/classes/Random/Hash.html +52 -52
- data/doc/rdoc/more/classes/Random/Object.html +4 -4
- data/doc/rdoc/more/classes/Random/String.html +34 -34
- data/doc/rdoc/more/classes/Random/String/Self.html +9 -9
- data/doc/rdoc/more/classes/Registerable.html +13 -13
- data/doc/rdoc/more/classes/Stash.html +28 -28
- data/doc/rdoc/more/classes/String/Mask.html +72 -72
- data/doc/rdoc/more/classes/String/Words.html +31 -31
- data/doc/rdoc/more/classes/System.html +253 -253
- data/doc/rdoc/more/classes/Timer.html +48 -48
- data/doc/rdoc/more/classes/Timer/Dummy.html +9 -9
- data/doc/rdoc/more/classes/Tuple.html +170 -170
- data/doc/rdoc/more/classes/TypeCast/Class.html +4 -4
- data/doc/rdoc/more/classes/TypeCast/Object.html +4 -4
- data/doc/rdoc/more/classes/Uninheritable.html +6 -6
- data/doc/rdoc/more/classes/X.html +117 -0
- data/doc/rdoc/more/classes/XOXO.html +11 -11
- data/doc/rdoc/more/classes/ZipUtils.html +88 -88
- data/doc/rdoc/more/classes/ZipUtils/DryRun.html +68 -68
- data/doc/rdoc/more/classes/ZipUtils/NoWrite.html +68 -68
- data/doc/rdoc/more/classes/ZipUtils/Verbose.html +60 -60
- data/doc/rdoc/more/created.rid +1 -1
- data/doc/rdoc/more/files/README.html +7 -29
- data/doc/rdoc/more/files/lib/more/facets/association_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/dictionary_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/hook_rb.html +96 -0
- data/doc/rdoc/more/files/lib/more/facets/paramix_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/xoxo_rb.html +2 -2
- data/doc/rdoc/more/fr_class_index.html +2 -0
- data/doc/rdoc/more/fr_file_index.html +1 -0
- data/doc/rdoc/more/fr_method_index.html +686 -681
- data/lib/core/facets/array/product.rb +6 -23
- data/lib/core/facets/enumerable/collect.rb +3 -53
- data/lib/core/facets/enumerable/compact_map.rb +35 -0
- data/lib/core/facets/enumerable/map_with_index.rb +23 -0
- data/lib/core/facets/enumerable/split.rb +3 -3
- data/lib/core/facets/hash/collate.rb +45 -14
- data/lib/core/facets/hash/group_by_value.rb +65 -0
- data/lib/core/facets/hash/new_with.rb +15 -0
- data/lib/core/facets/module/extend.rb +11 -0
- data/lib/core/facets/string/align.rb +19 -18
- data/lib/core/facets/string/file.rb +17 -0
- data/lib/core/facets/string/xor.rb +9 -3
- data/lib/core/facets/to_hash.rb +274 -17
- data/lib/core/facets/unboundmethod/name.rb +4 -2
- data/lib/lore/facets/ostruct.rb +3 -0
- data/lib/more/facets/association.rb +28 -12
- data/lib/more/facets/dictionary.rb +10 -4
- data/lib/more/facets/hook.rb +65 -0
- data/lib/more/facets/paramix.rb +5 -5
- data/meta/abstract +13 -0
- data/meta/authors +1 -0
- data/meta/contact +1 -0
- data/meta/contributors +48 -0
- data/meta/created +1 -0
- data/meta/homepage +1 -0
- data/meta/license +1 -0
- data/meta/loadpath +3 -0
- data/meta/releases +14 -0
- data/meta/slogan +1 -0
- data/meta/summary +1 -0
- data/task/test.rake +116 -18
- data/test/core/array/test_product.rb +0 -6
- data/test/core/binding/test_local_variables.rb +9 -3
- data/test/core/enumerable/test_split.rb +19 -0
- data/test/core/module/test_conflict.rb +8 -3
- data/test/core/test_to_hash.rb +152 -0
- data/test/core/unboundmethod/test_arguments.rb +1 -1
- data/test/core/unboundmethod/test_name.rb +2 -2
- metadata +39 -8
- data/doc/log/bstats/stats.html +0 -39
- data/doc/log/stats.html +0 -25
- data/test/more/test_to_hash.rb +0 -58
@@ -86,22 +86,22 @@ then parameters can be accessed via the mixin_parameters method.
|
|
86
86
|
end
|
87
87
|
|
88
88
|
class MyClass
|
89
|
-
include
|
89
|
+
include MyMixin[:name => 'Ruby']
|
90
90
|
end
|
91
91
|
|
92
92
|
m = MyClass.new
|
93
|
-
m.hello
|
93
|
+
m.hello #=> 'Hello from Ruby!'
|
94
94
|
</pre>
|
95
95
|
<p>
|
96
96
|
You can view the full set of parameters via the mixin_parameters class
|
97
97
|
method, which returns a hash keyed on the included modules.
|
98
98
|
</p>
|
99
99
|
<pre>
|
100
|
-
MyClass.mixin_parameters
|
100
|
+
MyClass.mixin_parameters #=> {MyMixin=>{:name=>'Ruby'}}
|
101
101
|
MyClass.mixin_parameters[MyMixin] #=> {:name=>'ruby'}
|
102
102
|
</pre>
|
103
103
|
<p>
|
104
|
-
The include
|
104
|
+
The include <a href="Paramix.html">Paramix</a> is equivalent to:
|
105
105
|
</p>
|
106
106
|
<pre>
|
107
107
|
def [](parameters)
|
@@ -109,10 +109,10 @@ The include Praamix is equivalent to:
|
|
109
109
|
end
|
110
110
|
</pre>
|
111
111
|
<p>
|
112
|
-
<a href="Paramix.html#
|
112
|
+
<a href="Paramix.html#M000912">Paramix.new</a> can also take a block that
|
113
113
|
injects code into the class or module including the parametric mixin. This
|
114
114
|
is useful as an alternative to using the included callback for creating
|
115
|
-
dynamic mixins
|
115
|
+
dynamic mixins. For example:
|
116
116
|
</p>
|
117
117
|
<pre>
|
118
118
|
def self.[](parameters)
|
@@ -138,8 +138,8 @@ As opposed to:
|
|
138
138
|
|
139
139
|
|
140
140
|
<div class="sectiontitle">Methods</div>
|
141
|
-
<span style="padding-right: 5px;"><a href="#
|
142
|
-
<span style="padding-right: 5px;"><a href="#
|
141
|
+
<span style="padding-right: 5px;"><a href="#M000911">append_features</a></span>
|
142
|
+
<span style="padding-right: 5px;"><a href="#M000912">new</a></span>
|
143
143
|
|
144
144
|
|
145
145
|
|
@@ -152,11 +152,11 @@ As opposed to:
|
|
152
152
|
<div class="sectiontitle">Public Class methods</div>
|
153
153
|
<div class="method">
|
154
154
|
<div class="title">
|
155
|
-
<a name="
|
155
|
+
<a name="M000911"></a><b>append_features</b>(base)
|
156
156
|
</div>
|
157
157
|
<div class="sourcecode">
|
158
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
159
|
-
<div id="
|
158
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000911_source')" id="l_M000911_source">+</a> ]</p>
|
159
|
+
<div id="M000911_source" class="dyn-source">
|
160
160
|
<pre>
|
161
161
|
<span class="ruby-comment cmt"># File lib/more/facets/paramix.rb, line 107</span>
|
162
162
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">append_features</span>(<span class="ruby-identifier">base</span>)
|
@@ -172,18 +172,18 @@ As opposed to:
|
|
172
172
|
</div>
|
173
173
|
<div class="method">
|
174
174
|
<div class="title">
|
175
|
-
<a name="
|
175
|
+
<a name="M000912"></a><b>new</b>(delegate_module, parameters={}, &base_block)
|
176
176
|
</div>
|
177
177
|
<div class="description">
|
178
178
|
<p>
|
179
179
|
<a href="It.html">It</a> you want to define the module‘s ::[] method
|
180
|
-
by hand. You can use <a href="Paramix.html#
|
181
|
-
of <a href="Paramix/Delegator.html#
|
180
|
+
by hand. You can use <a href="Paramix.html#M000912">Paramix.new</a> instead
|
181
|
+
of <a href="Paramix/Delegator.html#M000913">Paramix::Delegator.new</a>.
|
182
182
|
</p>
|
183
183
|
</div>
|
184
184
|
<div class="sourcecode">
|
185
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
186
|
-
<div id="
|
185
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000912_source')" id="l_M000912_source">+</a> ]</p>
|
186
|
+
<div id="M000912_source" class="dyn-source">
|
187
187
|
<pre>
|
188
188
|
<span class="ruby-comment cmt"># File lib/more/facets/paramix.rb, line 118</span>
|
189
189
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">delegate_module</span>, <span class="ruby-identifier">parameters</span>={}, <span class="ruby-operator">&</span><span class="ruby-identifier">base_block</span>)
|
@@ -81,10 +81,10 @@ Module
|
|
81
81
|
|
82
82
|
|
83
83
|
<div class="sectiontitle">Methods</div>
|
84
|
-
<span style="padding-right: 5px;"><a href="#
|
85
|
-
<span style="padding-right: 5px;"><a href="#
|
86
|
-
<span style="padding-right: 5px;"><a href="#
|
87
|
-
<span style="padding-right: 5px;"><a href="#
|
84
|
+
<span style="padding-right: 5px;"><a href="#M000916">[]</a></span>
|
85
|
+
<span style="padding-right: 5px;"><a href="#M000914">append_features</a></span>
|
86
|
+
<span style="padding-right: 5px;"><a href="#M000915">extend_object</a></span>
|
87
|
+
<span style="padding-right: 5px;"><a href="#M000913">new</a></span>
|
88
88
|
|
89
89
|
|
90
90
|
|
@@ -118,11 +118,11 @@ Module
|
|
118
118
|
<div class="sectiontitle">Public Class methods</div>
|
119
119
|
<div class="method">
|
120
120
|
<div class="title">
|
121
|
-
<a name="
|
121
|
+
<a name="M000913"></a><b>new</b>(module_delegate, parameters={}, &base_block)
|
122
122
|
</div>
|
123
123
|
<div class="sourcecode">
|
124
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
125
|
-
<div id="
|
124
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000913_source')" id="l_M000913_source">+</a> ]</p>
|
125
|
+
<div id="M000913_source" class="dyn-source">
|
126
126
|
<pre>
|
127
127
|
<span class="ruby-comment cmt"># File lib/more/facets/paramix.rb, line 132</span>
|
128
128
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">module_delegate</span>, <span class="ruby-identifier">parameters</span>={}, <span class="ruby-operator">&</span><span class="ruby-identifier">base_block</span>)
|
@@ -137,11 +137,11 @@ Module
|
|
137
137
|
<div class="sectiontitle">Public Instance methods</div>
|
138
138
|
<div class="method">
|
139
139
|
<div class="title">
|
140
|
-
<a name="
|
140
|
+
<a name="M000916"></a><b>[]</b>(name)
|
141
141
|
</div>
|
142
142
|
<div class="sourcecode">
|
143
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
144
|
-
<div id="
|
143
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000916_source')" id="l_M000916_source">+</a> ]</p>
|
144
|
+
<div id="M000916_source" class="dyn-source">
|
145
145
|
<pre>
|
146
146
|
<span class="ruby-comment cmt"># File lib/more/facets/paramix.rb, line 174</span>
|
147
147
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">name</span>)
|
@@ -153,11 +153,11 @@ Module
|
|
153
153
|
</div>
|
154
154
|
<div class="method">
|
155
155
|
<div class="title">
|
156
|
-
<a name="
|
156
|
+
<a name="M000914"></a><b>append_features</b>(base)
|
157
157
|
</div>
|
158
158
|
<div class="sourcecode">
|
159
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
160
|
-
<div id="
|
159
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000914_source')" id="l_M000914_source">+</a> ]</p>
|
160
|
+
<div id="M000914_source" class="dyn-source">
|
161
161
|
<pre>
|
162
162
|
<span class="ruby-comment cmt"># File lib/more/facets/paramix.rb, line 140</span>
|
163
163
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">append_features</span>(<span class="ruby-identifier">base</span>)
|
@@ -180,11 +180,11 @@ Module
|
|
180
180
|
</div>
|
181
181
|
<div class="method">
|
182
182
|
<div class="title">
|
183
|
-
<a name="
|
183
|
+
<a name="M000915"></a><b>extend_object</b>(base)
|
184
184
|
</div>
|
185
185
|
<div class="sourcecode">
|
186
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
187
|
-
<div id="
|
186
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000915_source')" id="l_M000915_source">+</a> ]</p>
|
187
|
+
<div id="M000915_source" class="dyn-source">
|
188
188
|
<pre>
|
189
189
|
<span class="ruby-comment cmt"># File lib/more/facets/paramix.rb, line 157</span>
|
190
190
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extend_object</span>(<span class="ruby-identifier">base</span>)
|
@@ -87,10 +87,10 @@ Read from one object and write to another.
|
|
87
87
|
|
88
88
|
|
89
89
|
<div class="sectiontitle">Methods</div>
|
90
|
-
<span style="padding-right: 5px;"><a href="#
|
91
|
-
<span style="padding-right: 5px;"><a href="#
|
92
|
-
<span style="padding-right: 5px;"><a href="#
|
93
|
-
<span style="padding-right: 5px;"><a href="#
|
90
|
+
<span style="padding-right: 5px;"><a href="#M000533">==</a></span>
|
91
|
+
<span style="padding-right: 5px;"><a href="#M000532">inspect</a></span>
|
92
|
+
<span style="padding-right: 5px;"><a href="#M000534">method_missing</a></span>
|
93
|
+
<span style="padding-right: 5px;"><a href="#M000531">new</a></span>
|
94
94
|
|
95
95
|
|
96
96
|
|
@@ -100,11 +100,11 @@ Read from one object and write to another.
|
|
100
100
|
<div class="sectiontitle">Public Class methods</div>
|
101
101
|
<div class="method">
|
102
102
|
<div class="title">
|
103
|
-
<a name="
|
103
|
+
<a name="M000531"></a><b>new</b>( write, &read )
|
104
104
|
</div>
|
105
105
|
<div class="sourcecode">
|
106
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
107
|
-
<div id="
|
106
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000531_source')" id="l_M000531_source">+</a> ]</p>
|
107
|
+
<div id="M000531_source" class="dyn-source">
|
108
108
|
<pre>
|
109
109
|
<span class="ruby-comment cmt"># File lib/more/facets/rwdelegator.rb, line 32</span>
|
110
110
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">write</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">read</span> )
|
@@ -134,11 +134,11 @@ Read from one object and write to another.
|
|
134
134
|
<div class="sectiontitle">Public Instance methods</div>
|
135
135
|
<div class="method">
|
136
136
|
<div class="title">
|
137
|
-
<a name="
|
137
|
+
<a name="M000533"></a><b>==</b>( other )
|
138
138
|
</div>
|
139
139
|
<div class="sourcecode">
|
140
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
141
|
-
<div id="
|
140
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000533_source')" id="l_M000533_source">+</a> ]</p>
|
141
|
+
<div id="M000533_source" class="dyn-source">
|
142
142
|
<pre>
|
143
143
|
<span class="ruby-comment cmt"># File lib/more/facets/rwdelegator.rb, line 57</span>
|
144
144
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>( <span class="ruby-identifier">other</span> )
|
@@ -150,11 +150,11 @@ Read from one object and write to another.
|
|
150
150
|
</div>
|
151
151
|
<div class="method">
|
152
152
|
<div class="title">
|
153
|
-
<a name="
|
153
|
+
<a name="M000532"></a><b>inspect</b>()
|
154
154
|
</div>
|
155
155
|
<div class="sourcecode">
|
156
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
157
|
-
<div id="
|
156
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000532_source')" id="l_M000532_source">+</a> ]</p>
|
157
|
+
<div id="M000532_source" class="dyn-source">
|
158
158
|
<pre>
|
159
159
|
<span class="ruby-comment cmt"># File lib/more/facets/rwdelegator.rb, line 53</span>
|
160
160
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span>
|
@@ -166,11 +166,11 @@ Read from one object and write to another.
|
|
166
166
|
</div>
|
167
167
|
<div class="method">
|
168
168
|
<div class="title">
|
169
|
-
<a name="
|
169
|
+
<a name="M000534"></a><b>method_missing</b>( meth, *args, &blk )
|
170
170
|
</div>
|
171
171
|
<div class="sourcecode">
|
172
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
173
|
-
<div id="
|
172
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000534_source')" id="l_M000534_source">+</a> ]</p>
|
173
|
+
<div id="M000534_source" class="dyn-source">
|
174
174
|
<pre>
|
175
175
|
<span class="ruby-comment cmt"># File lib/more/facets/rwdelegator.rb, line 61</span>
|
176
176
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>( <span class="ruby-identifier">meth</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">blk</span> )
|
@@ -83,7 +83,7 @@ reciever.
|
|
83
83
|
</p>
|
84
84
|
<p>
|
85
85
|
The most common example is <a
|
86
|
-
href="Random/Array.html#
|
86
|
+
href="Random/Array.html#M000813">Array#shuffle</a>, which simply
|
87
87
|
randmomizes the order of an array‘s elements.
|
88
88
|
</p>
|
89
89
|
<pre>
|
@@ -97,7 +97,7 @@ The other methods do similar things for their respective classes.
|
|
97
97
|
|
98
98
|
|
99
99
|
<div class="sectiontitle">Methods</div>
|
100
|
-
<span style="padding-right: 5px;"><a href="#
|
100
|
+
<span style="padding-right: 5px;"><a href="#M000793">append_features</a></span>
|
101
101
|
|
102
102
|
|
103
103
|
|
@@ -113,11 +113,11 @@ Module <a href="Random/String.html" class="link">Random::String</a><br />
|
|
113
113
|
<div class="sectiontitle">Public Class methods</div>
|
114
114
|
<div class="method">
|
115
115
|
<div class="title">
|
116
|
-
<a name="
|
116
|
+
<a name="M000793"></a><b>append_features</b>(mod)
|
117
117
|
</div>
|
118
118
|
<div class="sourcecode">
|
119
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
120
|
-
<div id="
|
119
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000793_source')" id="l_M000793_source">+</a> ]</p>
|
120
|
+
<div id="M000793_source" class="dyn-source">
|
121
121
|
<pre>
|
122
122
|
<span class="ruby-comment cmt"># File lib/more/facets/random.rb, line 66</span>
|
123
123
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">append_features</span>(<span class="ruby-identifier">mod</span>)
|
@@ -73,14 +73,14 @@
|
|
73
73
|
|
74
74
|
|
75
75
|
<div class="sectiontitle">Methods</div>
|
76
|
-
<span style="padding-right: 5px;"><a href="#
|
77
|
-
<span style="padding-right: 5px;"><a href="#
|
78
|
-
<span style="padding-right: 5px;"><a href="#
|
79
|
-
<span style="padding-right: 5px;"><a href="#
|
80
|
-
<span style="padding-right: 5px;"><a href="#
|
81
|
-
<span style="padding-right: 5px;"><a href="#
|
82
|
-
<span style="padding-right: 5px;"><a href="#
|
83
|
-
<span style="padding-right: 5px;"><a href="#
|
76
|
+
<span style="padding-right: 5px;"><a href="#M000807">at_rand</a></span>
|
77
|
+
<span style="padding-right: 5px;"><a href="#M000808">at_rand!</a></span>
|
78
|
+
<span style="padding-right: 5px;"><a href="#M000809">pick</a></span>
|
79
|
+
<span style="padding-right: 5px;"><a href="#M000810">pick!</a></span>
|
80
|
+
<span style="padding-right: 5px;"><a href="#M000811">rand_index</a></span>
|
81
|
+
<span style="padding-right: 5px;"><a href="#M000812">rand_subset</a></span>
|
82
|
+
<span style="padding-right: 5px;"><a href="#M000813">shuffle</a></span>
|
83
|
+
<span style="padding-right: 5px;"><a href="#M000814">shuffle!</a></span>
|
84
84
|
|
85
85
|
|
86
86
|
|
@@ -90,7 +90,7 @@
|
|
90
90
|
<div class="sectiontitle">Public Instance methods</div>
|
91
91
|
<div class="method">
|
92
92
|
<div class="title">
|
93
|
-
<a name="
|
93
|
+
<a name="M000807"></a><b>at_rand</b>()
|
94
94
|
</div>
|
95
95
|
<div class="description">
|
96
96
|
<p>
|
@@ -102,8 +102,8 @@ Return a random element of the array.
|
|
102
102
|
</pre>
|
103
103
|
</div>
|
104
104
|
<div class="sourcecode">
|
105
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
106
|
-
<div id="
|
105
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000807_source')" id="l_M000807_source">+</a> ]</p>
|
106
|
+
<div id="M000807_source" class="dyn-source">
|
107
107
|
<pre>
|
108
108
|
<span class="ruby-comment cmt"># File lib/more/facets/random.rb, line 107</span>
|
109
109
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">at_rand</span>
|
@@ -115,11 +115,11 @@ Return a random element of the array.
|
|
115
115
|
</div>
|
116
116
|
<div class="method">
|
117
117
|
<div class="title">
|
118
|
-
<a name="
|
118
|
+
<a name="M000808"></a><b>at_rand!</b>()
|
119
119
|
</div>
|
120
120
|
<div class="description">
|
121
121
|
<p>
|
122
|
-
Same as <a href="Array.html#
|
122
|
+
Same as <a href="Array.html#M000807">at_rand</a>, but acts in place
|
123
123
|
removing a random element from the array.
|
124
124
|
</p>
|
125
125
|
<pre>
|
@@ -129,8 +129,8 @@ removing a random element from the array.
|
|
129
129
|
</pre>
|
130
130
|
</div>
|
131
131
|
<div class="sourcecode">
|
132
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
133
|
-
<div id="
|
132
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000808_source')" id="l_M000808_source">+</a> ]</p>
|
133
|
+
<div id="M000808_source" class="dyn-source">
|
134
134
|
<pre>
|
135
135
|
<span class="ruby-comment cmt"># File lib/more/facets/random.rb, line 118</span>
|
136
136
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">at_rand!</span>
|
@@ -142,17 +142,17 @@ removing a random element from the array.
|
|
142
142
|
</div>
|
143
143
|
<div class="method">
|
144
144
|
<div class="title">
|
145
|
-
<a name="
|
145
|
+
<a name="M000809"></a><b>pick</b>(n=nil)
|
146
146
|
</div>
|
147
147
|
<div class="description">
|
148
148
|
<p>
|
149
|
-
Similar to <a href="Array.html#
|
149
|
+
Similar to <a href="Array.html#M000807">at_rand</a>, but will return an
|
150
150
|
array of randomly picked exclusive elements if given a number.
|
151
151
|
</p>
|
152
152
|
</div>
|
153
153
|
<div class="sourcecode">
|
154
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
155
|
-
<div id="
|
154
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000809_source')" id="l_M000809_source">+</a> ]</p>
|
155
|
+
<div id="M000809_source" class="dyn-source">
|
156
156
|
<pre>
|
157
157
|
<span class="ruby-comment cmt"># File lib/more/facets/random.rb, line 124</span>
|
158
158
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pick</span>(<span class="ruby-identifier">n</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -169,17 +169,17 @@ array of randomly picked exclusive elements if given a number.
|
|
169
169
|
</div>
|
170
170
|
<div class="method">
|
171
171
|
<div class="title">
|
172
|
-
<a name="
|
172
|
+
<a name="M000810"></a><b>pick!</b>(n=nil)
|
173
173
|
</div>
|
174
174
|
<div class="description">
|
175
175
|
<p>
|
176
|
-
Similar to <a href="Array.html#
|
176
|
+
Similar to <a href="Array.html#M000807">at_rand</a>!, but given a number
|
177
177
|
will return an array of exclusive elements.
|
178
178
|
</p>
|
179
179
|
</div>
|
180
180
|
<div class="sourcecode">
|
181
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
182
|
-
<div id="
|
181
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000810_source')" id="l_M000810_source">+</a> ]</p>
|
182
|
+
<div id="M000810_source" class="dyn-source">
|
183
183
|
<pre>
|
184
184
|
<span class="ruby-comment cmt"># File lib/more/facets/random.rb, line 135</span>
|
185
185
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pick!</span>(<span class="ruby-identifier">n</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -203,7 +203,7 @@ will return an array of exclusive elements.
|
|
203
203
|
</div>
|
204
204
|
<div class="method">
|
205
205
|
<div class="title">
|
206
|
-
<a name="
|
206
|
+
<a name="M000811"></a><b>rand_index</b>()
|
207
207
|
</div>
|
208
208
|
<div class="description">
|
209
209
|
<p>
|
@@ -211,8 +211,8 @@ will return an array of exclusive elements.
|
|
211
211
|
</p>
|
212
212
|
</div>
|
213
213
|
<div class="sourcecode">
|
214
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
215
|
-
<div id="
|
214
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000811_source')" id="l_M000811_source">+</a> ]</p>
|
215
|
+
<div id="M000811_source" class="dyn-source">
|
216
216
|
<pre>
|
217
217
|
<span class="ruby-comment cmt"># File lib/more/facets/random.rb, line 153</span>
|
218
218
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rand_index</span>
|
@@ -224,7 +224,7 @@ will return an array of exclusive elements.
|
|
224
224
|
</div>
|
225
225
|
<div class="method">
|
226
226
|
<div class="title">
|
227
|
-
<a name="
|
227
|
+
<a name="M000812"></a><b>rand_subset</b>( number=nil, exclusive=true )
|
228
228
|
</div>
|
229
229
|
<div class="description">
|
230
230
|
<p>
|
@@ -251,8 +251,8 @@ values are returned.
|
|
251
251
|
</pre>
|
252
252
|
</div>
|
253
253
|
<div class="sourcecode">
|
254
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
255
|
-
<div id="
|
254
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000812_source')" id="l_M000812_source">+</a> ]</p>
|
255
|
+
<div id="M000812_source" class="dyn-source">
|
256
256
|
<pre>
|
257
257
|
<span class="ruby-comment cmt"># File lib/more/facets/random.rb, line 175</span>
|
258
258
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rand_subset</span>( <span class="ruby-identifier">number</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">exclusive</span>=<span class="ruby-keyword kw">true</span> )
|
@@ -269,7 +269,7 @@ values are returned.
|
|
269
269
|
</div>
|
270
270
|
<div class="method">
|
271
271
|
<div class="title">
|
272
|
-
<a name="
|
272
|
+
<a name="M000813"></a><b>shuffle</b>()
|
273
273
|
</div>
|
274
274
|
<div class="description">
|
275
275
|
<p>
|
@@ -280,8 +280,8 @@ Randomize the order of an array.
|
|
280
280
|
</pre>
|
281
281
|
</div>
|
282
282
|
<div class="sourcecode">
|
283
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
284
|
-
<div id="
|
283
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000813_source')" id="l_M000813_source">+</a> ]</p>
|
284
|
+
<div id="M000813_source" class="dyn-source">
|
285
285
|
<pre>
|
286
286
|
<span class="ruby-comment cmt"># File lib/more/facets/random.rb, line 188</span>
|
287
287
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shuffle</span>
|
@@ -294,13 +294,13 @@ Randomize the order of an array.
|
|
294
294
|
</div>
|
295
295
|
<div class="method">
|
296
296
|
<div class="title">
|
297
|
-
<a name="
|
297
|
+
<a name="M000814"></a><b>shuffle!</b>()
|
298
298
|
</div>
|
299
299
|
<div class="description">
|
300
300
|
<p>
|
301
|
-
As with <a href="Array.html#
|
301
|
+
As with <a href="Array.html#M000813">shuffle</a> but modifies the array in
|
302
302
|
place. The algorithm used here is known as a Fisher-Yates <a
|
303
|
-
href="Array.html#
|
303
|
+
href="Array.html#M000813">shuffle</a>.
|
304
304
|
</p>
|
305
305
|
<pre>
|
306
306
|
a = [1,2,3,4]
|
@@ -312,8 +312,8 @@ CREDIT Niel Spring
|
|
312
312
|
</p>
|
313
313
|
</div>
|
314
314
|
<div class="sourcecode">
|
315
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
316
|
-
<div id="
|
315
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000814_source')" id="l_M000814_source">+</a> ]</p>
|
316
|
+
<div id="M000814_source" class="dyn-source">
|
317
317
|
<pre>
|
318
318
|
<span class="ruby-comment cmt"># File lib/more/facets/random.rb, line 202</span>
|
319
319
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shuffle!</span>
|