facets 2.4.2 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -1
- data/CHANGES +25 -5
- data/MANIFEST +67 -34
- data/METADATA +2 -2
- data/NEWS +54 -46
- data/doc/news/NEWS-2.4.0 +52 -0
- data/doc/rdoc/core/classes/Array.html +198 -198
- data/doc/rdoc/core/classes/Binding.html +86 -192
- data/doc/rdoc/core/classes/Class.html +136 -136
- data/doc/rdoc/core/classes/Comparable.html +45 -45
- data/doc/rdoc/core/classes/Dir.html +64 -64
- data/doc/rdoc/core/classes/Enumerable.html +287 -281
- data/doc/rdoc/core/classes/Exception.html +16 -16
- data/doc/rdoc/core/classes/FalseClass.html +8 -8
- data/doc/rdoc/core/classes/File.html +100 -100
- data/doc/rdoc/core/classes/FileTest.html +8 -8
- data/doc/rdoc/core/classes/Float.html +32 -32
- data/doc/rdoc/core/classes/Friend.html +8 -8
- data/doc/rdoc/core/classes/Functor.html +12 -12
- data/doc/rdoc/core/classes/Hash.html +439 -847
- data/doc/rdoc/{more → core}/classes/Indexable.html +115 -115
- data/doc/rdoc/core/classes/InstanceVariables.html +88 -88
- data/doc/rdoc/core/classes/Integer.html +142 -142
- data/doc/rdoc/core/classes/Kernel.html +602 -600
- data/doc/rdoc/core/classes/Lazy/Promise.html +1 -1
- data/doc/rdoc/core/classes/MatchData.html +30 -30
- data/doc/rdoc/core/classes/Module.html +379 -327
- data/doc/rdoc/core/classes/NilClass.html +32 -32
- data/doc/rdoc/core/classes/Numeric.html +46 -46
- data/doc/rdoc/core/classes/Object.html +4 -4
- data/doc/rdoc/core/classes/Proc.html +46 -134
- data/doc/rdoc/core/classes/Range.html +60 -60
- data/doc/rdoc/core/classes/Regexp.html +28 -28
- data/doc/rdoc/{more → core}/classes/Stackable.html +38 -38
- data/doc/rdoc/core/classes/String.html +844 -504
- data/doc/rdoc/core/classes/Symbol.html +62 -62
- data/doc/rdoc/core/classes/Time.html +112 -112
- data/doc/rdoc/core/classes/TrueClass.html +8 -8
- data/doc/rdoc/core/classes/UnboundMethod.html +22 -22
- data/doc/rdoc/core/created.rid +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array_rb.html +4 -1
- data/doc/rdoc/core/files/lib/core/facets/binding_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/boolean_rb.html +2 -2
- data/doc/rdoc/core/files/lib/core/facets/class/methodize_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/class/pathize_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/class_rb.html +5 -1
- data/doc/rdoc/core/files/lib/core/facets/dir_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/{class/to_methodname_rb.html → enumerable/commonality_rb.html} +4 -4
- data/doc/rdoc/core/files/lib/core/facets/enumerable/entropy_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/{class/to_pathname_rb.html → enumerable/frequency_rb.html} +4 -4
- data/doc/rdoc/core/files/lib/core/facets/enumerable/probability_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable_rb.html +6 -2
- data/doc/rdoc/core/files/lib/core/facets/file_rb.html +2 -1
- data/doc/rdoc/core/files/lib/core/facets/hash_rb.html +7 -1
- data/doc/rdoc/{more/files/lib/more → core/files/lib/core}/facets/indexable_rb.html +2 -2
- data/doc/rdoc/core/files/lib/core/facets/kernel/require_all_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/kernel/require_local_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/kernel_rb.html +15 -2
- data/doc/rdoc/core/files/lib/core/facets/module/integrate_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/module/methodize_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/module/module_load_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/pathize_rb.html +5 -1
- data/doc/rdoc/core/files/lib/core/facets/module/redefine_method_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/module/redirect_method_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/module/rename_method_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/module/revise_rb.html +8 -1
- data/doc/rdoc/core/files/lib/core/facets/module/wrap_method_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/module_rb.html +8 -5
- data/doc/rdoc/core/files/lib/core/facets/numeric_rb.html +2 -1
- data/doc/rdoc/core/files/lib/core/facets/proc_rb.html +3 -5
- data/doc/rdoc/{more/files/lib/more → core/files/lib/core}/facets/stackable_rb.html +3 -4
- data/doc/rdoc/core/files/lib/core/facets/string/each_word_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/{module/clone_rb.html → string/methodize_rb.html} +4 -4
- data/doc/rdoc/core/files/lib/core/facets/{kernel/load_rb.html → string/pathize_rb.html} +4 -4
- data/doc/rdoc/core/files/lib/core/facets/string/word_wrap_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/words_rb.html +1 -5
- data/doc/rdoc/core/files/lib/core/facets/string_rb.html +8 -3
- data/doc/rdoc/core/files/lib/core/facets/symbol_rb.html +2 -1
- data/doc/rdoc/core/fr_class_index.html +2 -3
- data/doc/rdoc/core/fr_file_index.html +36 -16
- data/doc/rdoc/core/fr_method_index.html +778 -784
- data/doc/rdoc/lore/created.rid +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 +28 -28
- data/doc/rdoc/more/classes/Association/Kernel.html +8 -8
- data/doc/rdoc/more/classes/Autoarray.html +12 -12
- data/doc/rdoc/more/classes/BBCode.html +34 -34
- data/doc/rdoc/more/classes/BaseX.html +16 -16
- data/doc/rdoc/more/classes/BiCrypt.html +67 -67
- data/doc/rdoc/more/classes/BigDuration.html +30 -30
- 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 +201 -0
- data/doc/rdoc/more/classes/Buildable.html +4 -4
- data/doc/rdoc/more/classes/BuildingBlock.html +32 -32
- data/doc/rdoc/more/classes/CLI.html +108 -0
- data/doc/rdoc/more/classes/CLI/Arguments.html +76 -76
- data/doc/rdoc/more/classes/CLI/Command.html +22 -22
- data/doc/rdoc/more/classes/CLI/NoCommandError.html +4 -4
- data/doc/rdoc/more/classes/CLI/NoOptionError.html +4 -4
- data/doc/rdoc/more/classes/CacheDecorator.html +21 -21
- data/doc/rdoc/more/classes/Capsule.html +41 -41
- data/doc/rdoc/more/classes/Chain.html +17 -17
- data/doc/rdoc/more/classes/Cloneable.html +4 -4
- data/doc/rdoc/more/classes/ConsoleUtils.html +18 -18
- data/doc/rdoc/more/classes/Coroutine.html +28 -28
- data/doc/rdoc/more/classes/Crypt.html +16 -16
- data/doc/rdoc/more/classes/CssFilter.html +45 -45
- data/doc/rdoc/more/classes/CssTree.html +8 -8
- data/doc/rdoc/more/classes/Dictionary.html +228 -228
- data/doc/rdoc/more/classes/DictionaryMatcher.html +38 -38
- data/doc/rdoc/more/classes/DictionaryMatcher/MatchData.html +4 -4
- data/doc/rdoc/more/classes/Downloader.html +56 -56
- data/doc/rdoc/more/classes/Duration.html +68 -68
- data/doc/rdoc/more/classes/Enumerable.html +44 -44
- 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/EnumerablePass.html +15 -15
- data/doc/rdoc/more/classes/Equatable.html +16 -16
- data/doc/rdoc/more/classes/EventHook.html +8 -8
- data/doc/rdoc/more/classes/Expirable.html +17 -17
- data/doc/rdoc/more/classes/FileList.html +125 -125
- data/doc/rdoc/more/classes/FileShell.html +147 -147
- data/doc/rdoc/more/classes/Fileable.html +14 -14
- data/doc/rdoc/more/classes/Fileable/DSL.html +41 -41
- data/doc/rdoc/more/classes/Hash.html +306 -14
- data/doc/rdoc/more/classes/Hash2Xml.html +4 -4
- data/doc/rdoc/more/classes/HtmlFilter.html +9 -9
- data/doc/rdoc/more/classes/IORedirect.html +19 -19
- data/doc/rdoc/more/classes/InfinityClass.html +36 -36
- data/doc/rdoc/more/classes/InfinityClass/Numeric.html +23 -23
- data/doc/rdoc/more/classes/Ini.html +37 -37
- data/doc/rdoc/more/classes/Instantiable.html +9 -9
- data/doc/rdoc/more/classes/Instantise.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/Kernel.html +77 -77
- data/doc/rdoc/more/classes/LRUCache.html +38 -38
- data/doc/rdoc/more/classes/LinkedList.html +68 -68
- data/doc/rdoc/more/classes/LinkedList/Node.html +4 -4
- data/doc/rdoc/{core → more}/classes/MissingArgument.html +1 -2
- data/doc/rdoc/more/classes/Module.html +171 -171
- 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 +19 -19
- data/doc/rdoc/more/classes/NullClass.html +24 -24
- data/doc/rdoc/more/classes/ObjectReflection.html +12 -12
- data/doc/rdoc/more/classes/OpEsc.html +5 -5
- data/doc/rdoc/more/classes/OpenCascade.html +4 -4
- data/doc/rdoc/more/classes/OpenCollection.html +8 -8
- data/doc/rdoc/more/classes/OpenHash.html +9 -9
- data/doc/rdoc/more/classes/OpenObject.html +95 -95
- data/doc/rdoc/more/classes/PQueue.html +84 -84
- data/doc/rdoc/more/classes/Paramix.html +11 -11
- data/doc/rdoc/more/classes/Paramix/Delegator.html +16 -16
- data/doc/rdoc/more/classes/PathList.html +8 -8
- data/doc/rdoc/more/classes/PathList/Finder.html +8 -8
- data/doc/rdoc/more/classes/Platform.html +46 -46
- data/doc/rdoc/more/classes/Pool.html +18 -18
- data/doc/rdoc/more/classes/Proc.html +48 -4
- data/doc/rdoc/more/classes/ProgressBar.html +52 -52
- data/doc/rdoc/more/classes/Prototype.html +28 -28
- data/doc/rdoc/more/classes/RWDelegator.html +16 -16
- data/doc/rdoc/more/classes/Random.html +9 -9
- 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/Recorder.html +16 -16
- data/doc/rdoc/more/classes/Reference.html +19 -19
- data/doc/rdoc/more/classes/Registerable.html +13 -13
- data/doc/rdoc/more/classes/Semaphore.html +36 -36
- data/doc/rdoc/more/classes/Settings.html +28 -28
- data/doc/rdoc/more/classes/Settings/Setting.html +13 -13
- data/doc/rdoc/more/classes/Settings/SettingCollection.html +4 -4
- data/doc/rdoc/more/classes/SimpleStringIO.html +8 -8
- data/doc/rdoc/more/classes/Snapshot.html +16 -16
- data/doc/rdoc/more/classes/Snapshot/ValueHolder.html +12 -12
- data/doc/rdoc/more/classes/String/Style.html +113 -113
- data/doc/rdoc/{core → more}/classes/String/Words.html +78 -78
- data/doc/rdoc/more/classes/Struct.html +8 -8
- data/doc/rdoc/more/classes/SyncArray.html +4 -4
- data/doc/rdoc/more/classes/SyncHash.html +4 -4
- data/doc/rdoc/more/classes/SyncHash/Delegator.html +28 -28
- data/doc/rdoc/more/classes/SyncHash/Inheritor.html +28 -28
- 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/TracePoint.html +64 -62
- 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/UploadUtils.html +49 -49
- data/doc/rdoc/more/classes/VersionNumber.html +53 -53
- data/doc/rdoc/more/classes/Weekdays.html +28 -28
- data/doc/rdoc/more/classes/XOXO.html +9 -9
- data/doc/rdoc/more/classes/ZipUtils.html +58 -58
- data/doc/rdoc/more/classes/ZipUtils/DryRun.html +28 -28
- data/doc/rdoc/more/classes/ZipUtils/NoWrite.html +28 -28
- data/doc/rdoc/more/classes/ZipUtils/Verbose.html +28 -28
- data/doc/rdoc/more/created.rid +1 -1
- data/doc/rdoc/more/files/lib/more/facets/ansicode_rb.html +1 -1
- data/doc/rdoc/{core/files/lib/core → more/files/lib/more}/facets/binding/opvars_rb.html +2 -2
- data/doc/rdoc/{core/files/lib/core → more/files/lib/more}/facets/hash/stringify_keys_rb.html +2 -2
- data/doc/rdoc/{core/files/lib/core → more/files/lib/more}/facets/hash/symbolize_keys_rb.html +2 -2
- data/doc/rdoc/{core/files/lib/core/facets/proc → more/files/lib/more/facets}/partial_rb.html +8 -7
- data/doc/rdoc/more/files/lib/more/facets/snapshot_rb.html +2 -2
- data/doc/rdoc/more/files/lib/more/facets/string/words_rb.html +96 -0
- data/doc/rdoc/more/files/lib/more/facets/tracepoint_rb.html +13 -8
- data/doc/rdoc/more/fr_class_index.html +4 -2
- data/doc/rdoc/more/fr_file_index.html +9 -2
- data/doc/rdoc/more/fr_method_index.html +1013 -1009
- data/doc/ri/CLI/cdesc-CLI.yaml +7 -2
- data/doc/ri/Enumerable/probability-i.yaml +1 -1
- data/doc/ri/Module/append_features-i.yaml +4 -3
- data/doc/ri/Module/cdesc-Module.yaml +4 -3
- data/doc/ri/Module/methodize-i.yaml +14 -0
- data/doc/ri/Module/redefine_method-i.yaml +1 -1
- data/doc/ri/Module/redirect_method-i.yaml +3 -1
- data/doc/ri/Module/rename_method-i.yaml +1 -1
- data/doc/ri/created.rid +1 -1
- data/lib/core/facets/array.rb +3 -0
- data/lib/core/facets/binding.rb +0 -1
- data/lib/core/facets/class.rb +4 -4
- data/lib/core/facets/class/{to_methodname.rb → methodize.rb} +5 -2
- data/lib/core/facets/class/pathize.rb +14 -0
- data/lib/core/facets/enumerable.rb +5 -2
- data/lib/core/facets/enumerable/commonality.rb +33 -0
- data/lib/core/facets/enumerable/entropy.rb +37 -0
- data/lib/core/facets/enumerable/frequency.rb +18 -0
- data/lib/core/facets/enumerable/probability.rb +1 -98
- data/lib/core/facets/file.rb +1 -1
- data/lib/core/facets/hash.rb +6 -0
- data/lib/{more → core}/facets/indexable.rb +0 -0
- data/lib/core/facets/kernel.rb +15 -1
- data/lib/core/facets/kernel/require_all.rb +21 -0
- data/lib/core/facets/kernel/{load.rb → require_local.rb} +6 -23
- data/lib/core/facets/module.rb +7 -3
- data/lib/core/facets/module/integrate.rb +2 -0
- data/lib/core/facets/module/methodize.rb +14 -0
- data/lib/core/facets/module/pathize.rb +10 -7
- data/lib/core/facets/module/redefine_method.rb +35 -0
- data/lib/core/facets/module/redirect_method.rb +45 -0
- data/lib/core/facets/module/rename_method.rb +20 -0
- data/lib/core/facets/module/revise.rb +7 -113
- data/lib/core/facets/module/wrap_method.rb +28 -0
- data/lib/core/facets/numeric.rb +1 -1
- data/lib/core/facets/proc.rb +2 -3
- data/lib/{more → core}/facets/stackable.rb +0 -0
- data/lib/core/facets/string.rb +8 -6
- data/lib/core/facets/string/each_word.rb +13 -0
- data/lib/core/facets/string/methodize.rb +12 -0
- data/lib/core/facets/string/pathize.rb +12 -0
- data/lib/core/facets/string/word_wrap.rb +34 -0
- data/lib/core/facets/string/words.rb +6 -167
- data/lib/core/facets/symbol.rb +1 -0
- data/lib/more/facets/ansicode.rb +4 -4
- data/lib/{core → more}/facets/binding/opvars.rb +0 -0
- data/lib/{core → more}/facets/hash/stringify_keys.rb +0 -0
- data/lib/{core → more}/facets/hash/symbolize_keys.rb +5 -6
- data/lib/{core/facets/proc → more/facets}/partial.rb +0 -0
- data/lib/more/facets/string/words.rb +173 -0
- data/test/core/dir/test_multiglob.rb +1 -0
- data/test/core/dir/test_recurse.rb +1 -0
- data/test/core/enumerable/test_commonality.rb +15 -0
- data/test/core/enumerable/test_entropy.rb +15 -0
- data/test/core/enumerable/test_frequency.rb +11 -0
- data/test/core/enumerable/test_probability.rb +1 -34
- data/test/core/string/test_each_word.rb +14 -0
- data/test/core/string/test_fold.rb +1 -1
- data/test/core/string/test_word_wrap.rb +35 -0
- data/test/core/string/test_words.rb +12 -61
- data/test/more/test_command.rb +7 -9
- data/test/more/test_paramix.rb +4 -1
- data/test/{core/proc → more}/test_partial.rb +1 -1
- metadata +75 -38
- data/doc/rdoc/core/classes/Module/CloneExtensions.html +0 -287
- data/doc/ri/Module/CloneExtensions/cdesc-CloneExtensions.yaml +0 -20
- data/doc/ri/Module/CloneExtensions/clone_removing-i.yaml +0 -14
- data/doc/ri/Module/CloneExtensions/clone_renaming-i.yaml +0 -14
- data/doc/ri/Module/CloneExtensions/clone_using-i.yaml +0 -14
- data/lib/core/facets/class/to_pathname.rb +0 -12
- data/lib/core/facets/module/clone.rb +0 -57
- data/test/core/module/test_clone.rb +0 -45
@@ -57,7 +57,7 @@
|
|
57
57
|
<tr valign="top">
|
58
58
|
<td>In:</td>
|
59
59
|
<td>
|
60
|
-
<a href="../files/lib/
|
60
|
+
<a href="../files/lib/core/facets/indexable_rb.html">lib/core/facets/indexable.rb</a>
|
61
61
|
</td>
|
62
62
|
</tr>
|
63
63
|
</table>
|
@@ -88,23 +88,23 @@ indexable object.
|
|
88
88
|
|
89
89
|
<div class="sectiontitle">Methods</div>
|
90
90
|
<ul>
|
91
|
-
<li><a href="#
|
92
|
-
<li><a href="#
|
93
|
-
<li><a href="#
|
94
|
-
<li><a href="#
|
95
|
-
<li><a href="#
|
96
|
-
<li><a href="#
|
97
|
-
<li><a href="#
|
98
|
-
<li><a href="#
|
99
|
-
<li><a href="#
|
100
|
-
<li><a href="#
|
101
|
-
<li><a href="#
|
102
|
-
<li><a href="#
|
103
|
-
<li><a href="#
|
104
|
-
<li><a href="#
|
105
|
-
<li><a href="#
|
106
|
-
<li><a href="#
|
107
|
-
<li><a href="#
|
91
|
+
<li><a href="#M000575">body</a></li>
|
92
|
+
<li><a href="#M000585">ends</a></li>
|
93
|
+
<li><a href="#M000579">first</a></li>
|
94
|
+
<li><a href="#M000583">first!</a></li>
|
95
|
+
<li><a href="#M000581">first=</a></li>
|
96
|
+
<li><a href="#M000574">foot</a></li>
|
97
|
+
<li><a href="#M000572">head</a></li>
|
98
|
+
<li><a href="#M000587">index_of</a></li>
|
99
|
+
<li><a href="#M000580">last</a></li>
|
100
|
+
<li><a href="#M000584">last!</a></li>
|
101
|
+
<li><a href="#M000582">last=</a></li>
|
102
|
+
<li><a href="#M000576">mid</a></li>
|
103
|
+
<li><a href="#M000577">middle</a></li>
|
104
|
+
<li><a href="#M000586">pos</a></li>
|
105
|
+
<li><a href="#M000588">range</a></li>
|
106
|
+
<li><a href="#M000573">tail</a></li>
|
107
|
+
<li><a href="#M000578">thru</a></li>
|
108
108
|
</ul>
|
109
109
|
|
110
110
|
|
@@ -115,12 +115,12 @@ indexable object.
|
|
115
115
|
<div class="sectiontitle">Public Instance methods</div>
|
116
116
|
<div class="method">
|
117
117
|
<div class="title">
|
118
|
-
<a name="
|
118
|
+
<a name="M000575"></a><b>body</b>()
|
119
119
|
</div>
|
120
120
|
<div class="description">
|
121
121
|
<p>
|
122
|
-
Returns an array of the <a href="Indexable.html#
|
123
|
-
upto, but not including, the <a href="Indexable.html#
|
122
|
+
Returns an array of the <a href="Indexable.html#M000579">first</a> element
|
123
|
+
upto, but not including, the <a href="Indexable.html#M000580">last</a>
|
124
124
|
element.
|
125
125
|
</p>
|
126
126
|
<pre>
|
@@ -128,10 +128,10 @@ element.
|
|
128
128
|
</pre>
|
129
129
|
</div>
|
130
130
|
<div class="sourcecode">
|
131
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
132
|
-
<div id="
|
131
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000575_source')" id="l_M000575_source">show source</a> ]</p>
|
132
|
+
<div id="M000575_source" class="dyn-source">
|
133
133
|
<pre>
|
134
|
-
<span class="ruby-comment cmt"># File lib/
|
134
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 71</span>
|
135
135
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">body</span>
|
136
136
|
<span class="ruby-identifier">slice</span>(<span class="ruby-value">0</span>,<span class="ruby-identifier">size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)
|
137
137
|
<span class="ruby-keyword kw">end</span>
|
@@ -141,12 +141,12 @@ element.
|
|
141
141
|
</div>
|
142
142
|
<div class="method">
|
143
143
|
<div class="title">
|
144
|
-
<a name="
|
144
|
+
<a name="M000585"></a><b>ends</b>()
|
145
145
|
</div>
|
146
146
|
<div class="description">
|
147
147
|
<p>
|
148
|
-
A shorting of "<a href="Indexable.html#
|
149
|
-
returns the <a href="Indexable.html#
|
148
|
+
A shorting of "<a href="Indexable.html#M000585">ends</a> at",
|
149
|
+
returns the <a href="Indexable.html#M000580">last</a> index of the
|
150
150
|
indexable object. Returns nil if there are no elements.
|
151
151
|
</p>
|
152
152
|
<pre>
|
@@ -157,10 +157,10 @@ This nearly equivalent to +size - 1+.
|
|
157
157
|
</p>
|
158
158
|
</div>
|
159
159
|
<div class="sourcecode">
|
160
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
161
|
-
<div id="
|
160
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000585_source')" id="l_M000585_source">show source</a> ]</p>
|
161
|
+
<div id="M000585_source" class="dyn-source">
|
162
162
|
<pre>
|
163
|
-
<span class="ruby-comment cmt"># File lib/
|
163
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 192</span>
|
164
164
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ends</span>
|
165
165
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
166
166
|
<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
@@ -171,21 +171,21 @@ This nearly equivalent to +size - 1+.
|
|
171
171
|
</div>
|
172
172
|
<div class="method">
|
173
173
|
<div class="title">
|
174
|
-
<a name="
|
174
|
+
<a name="M000579"></a><b>first</b>(n=1)
|
175
175
|
</div>
|
176
176
|
<div class="description">
|
177
177
|
<p>
|
178
|
-
Returns <a href="Indexable.html#
|
178
|
+
Returns <a href="Indexable.html#M000579">first</a> <em>n</em> elements.
|
179
179
|
</p>
|
180
180
|
<pre>
|
181
181
|
"Hello World".first(3) #=> "Hel"
|
182
182
|
</pre>
|
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('M000579_source')" id="l_M000579_source">show source</a> ]</p>
|
186
|
+
<div id="M000579_source" class="dyn-source">
|
187
187
|
<pre>
|
188
|
-
<span class="ruby-comment cmt"># File lib/
|
188
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 130</span>
|
189
189
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">first</span>(<span class="ruby-identifier">n</span>=<span class="ruby-value">1</span>)
|
190
190
|
<span class="ruby-identifier">slice</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_i</span>)
|
191
191
|
<span class="ruby-keyword kw">end</span>
|
@@ -195,11 +195,11 @@ Returns <a href="Indexable.html#M000724">first</a> <em>n</em> elements.
|
|
195
195
|
</div>
|
196
196
|
<div class="method">
|
197
197
|
<div class="title">
|
198
|
-
<a name="
|
198
|
+
<a name="M000583"></a><b>first!</b>()
|
199
199
|
</div>
|
200
200
|
<div class="description">
|
201
201
|
<p>
|
202
|
-
Remove and return the <a href="Indexable.html#
|
202
|
+
Remove and return the <a href="Indexable.html#M000579">first</a> element.
|
203
203
|
</p>
|
204
204
|
<pre>
|
205
205
|
a = [1,2,3]
|
@@ -208,10 +208,10 @@ Remove and return the <a href="Indexable.html#M000724">first</a> element.
|
|
208
208
|
</pre>
|
209
209
|
</div>
|
210
210
|
<div class="sourcecode">
|
211
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
212
|
-
<div id="
|
211
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000583_source')" id="l_M000583_source">show source</a> ]</p>
|
212
|
+
<div id="M000583_source" class="dyn-source">
|
213
213
|
<pre>
|
214
|
-
<span class="ruby-comment cmt"># File lib/
|
214
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 170</span>
|
215
215
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">first!</span>
|
216
216
|
<span class="ruby-identifier">splice</span>(<span class="ruby-value">0</span>)
|
217
217
|
<span class="ruby-keyword kw">end</span>
|
@@ -221,11 +221,11 @@ Remove and return the <a href="Indexable.html#M000724">first</a> element.
|
|
221
221
|
</div>
|
222
222
|
<div class="method">
|
223
223
|
<div class="title">
|
224
|
-
<a name="
|
224
|
+
<a name="M000581"></a><b>first=</b>(x)
|
225
225
|
</div>
|
226
226
|
<div class="description">
|
227
227
|
<p>
|
228
|
-
Change the <a href="Indexable.html#
|
228
|
+
Change the <a href="Indexable.html#M000579">first</a> element.
|
229
229
|
</p>
|
230
230
|
<pre>
|
231
231
|
a = ["a","y","z"]
|
@@ -234,10 +234,10 @@ Change the <a href="Indexable.html#M000724">first</a> element.
|
|
234
234
|
</pre>
|
235
235
|
</div>
|
236
236
|
<div class="sourcecode">
|
237
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
238
|
-
<div id="
|
237
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000581_source')" id="l_M000581_source">show source</a> ]</p>
|
238
|
+
<div id="M000581_source" class="dyn-source">
|
239
239
|
<pre>
|
240
|
-
<span class="ruby-comment cmt"># File lib/
|
240
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 150</span>
|
241
241
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">first=</span>(<span class="ruby-identifier">x</span>)
|
242
242
|
<span class="ruby-identifier">splice</span>(<span class="ruby-value">0</span>,<span class="ruby-identifier">x</span>)
|
243
243
|
<span class="ruby-keyword kw">end</span>
|
@@ -247,22 +247,22 @@ Change the <a href="Indexable.html#M000724">first</a> element.
|
|
247
247
|
</div>
|
248
248
|
<div class="method">
|
249
249
|
<div class="title">
|
250
|
-
<a name="
|
250
|
+
<a name="M000574"></a><b>foot</b>()
|
251
251
|
</div>
|
252
252
|
<div class="description">
|
253
253
|
<p>
|
254
|
-
Like <a href="Indexable.html#
|
255
|
-
href="Indexable.html#
|
254
|
+
Like <a href="Indexable.html#M000580">last</a>, returning the <a
|
255
|
+
href="Indexable.html#M000580">last</a> element in an array.
|
256
256
|
</p>
|
257
257
|
<pre>
|
258
258
|
[1,2,3].foot #=> [3]
|
259
259
|
</pre>
|
260
260
|
</div>
|
261
261
|
<div class="sourcecode">
|
262
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
263
|
-
<div id="
|
262
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000574_source')" id="l_M000574_source">show source</a> ]</p>
|
263
|
+
<div id="M000574_source" class="dyn-source">
|
264
264
|
<pre>
|
265
|
-
<span class="ruby-comment cmt"># File lib/
|
265
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 58</span>
|
266
266
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foot</span>
|
267
267
|
<span class="ruby-identifier">slice</span>(<span class="ruby-value">-1</span>,<span class="ruby-value">1</span>)
|
268
268
|
<span class="ruby-keyword kw">end</span>
|
@@ -272,22 +272,22 @@ href="Indexable.html#M000725">last</a> element in an array.
|
|
272
272
|
</div>
|
273
273
|
<div class="method">
|
274
274
|
<div class="title">
|
275
|
-
<a name="
|
275
|
+
<a name="M000572"></a><b>head</b>()
|
276
276
|
</div>
|
277
277
|
<div class="description">
|
278
278
|
<p>
|
279
|
-
Like <a href="Indexable.html#
|
280
|
-
href="Indexable.html#
|
279
|
+
Like <a href="Indexable.html#M000579">first</a> but returns the <a
|
280
|
+
href="Indexable.html#M000579">first</a> element in a new array.
|
281
281
|
</p>
|
282
282
|
<pre>
|
283
283
|
[1,2,3].head #=> [1]
|
284
284
|
</pre>
|
285
285
|
</div>
|
286
286
|
<div class="sourcecode">
|
287
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
288
|
-
<div id="
|
287
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000572_source')" id="l_M000572_source">show source</a> ]</p>
|
288
|
+
<div id="M000572_source" class="dyn-source">
|
289
289
|
<pre>
|
290
|
-
<span class="ruby-comment cmt"># File lib/
|
290
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 41</span>
|
291
291
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">head</span>
|
292
292
|
<span class="ruby-identifier">slice</span>(<span class="ruby-value">0</span>,<span class="ruby-value">1</span>)
|
293
293
|
<span class="ruby-keyword kw">end</span>
|
@@ -297,11 +297,11 @@ href="Indexable.html#M000724">first</a> element in a new array.
|
|
297
297
|
</div>
|
298
298
|
<div class="method">
|
299
299
|
<div class="title">
|
300
|
-
<a name="
|
300
|
+
<a name="M000587"></a><b>index_of</b>(obj=nil) {|self[i]| ...}
|
301
301
|
</div>
|
302
302
|
<div class="description">
|
303
303
|
<p>
|
304
|
-
Returns the index of the <a href="Indexable.html#
|
304
|
+
Returns the index of the <a href="Indexable.html#M000579">first</a> element
|
305
305
|
to satisfy the block condition. This is simply index with a block.
|
306
306
|
</p>
|
307
307
|
<pre>
|
@@ -313,10 +313,10 @@ TODO: Remove Array#index_of when Ruby 1.9 adds block to index.
|
|
313
313
|
</p>
|
314
314
|
</div>
|
315
315
|
<div class="sourcecode">
|
316
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
317
|
-
<div id="
|
316
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000587_source')" id="l_M000587_source">show source</a> ]</p>
|
317
|
+
<div id="M000587_source" class="dyn-source">
|
318
318
|
<pre>
|
319
|
-
<span class="ruby-comment cmt"># File lib/
|
319
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 219</span>
|
320
320
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index_of</span>(<span class="ruby-identifier">obj</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-operator">&</span><span class="ruby-identifier">blk</span>)
|
321
321
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">index</span>(<span class="ruby-identifier">obj</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
|
322
322
|
<span class="ruby-identifier">i</span>=<span class="ruby-value">0</span>; <span class="ruby-identifier">i</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span> <span class="ruby-keyword kw">until</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">i</span>])
|
@@ -328,21 +328,21 @@ TODO: Remove Array#index_of when Ruby 1.9 adds block to index.
|
|
328
328
|
</div>
|
329
329
|
<div class="method">
|
330
330
|
<div class="title">
|
331
|
-
<a name="
|
331
|
+
<a name="M000580"></a><b>last</b>(n=1)
|
332
332
|
</div>
|
333
333
|
<div class="description">
|
334
334
|
<p>
|
335
|
-
Returns <a href="Indexable.html#
|
335
|
+
Returns <a href="Indexable.html#M000580">last</a> <em>n</em> elements.
|
336
336
|
</p>
|
337
337
|
<pre>
|
338
338
|
"Hello World".last(3) #=> "rld"
|
339
339
|
</pre>
|
340
340
|
</div>
|
341
341
|
<div class="sourcecode">
|
342
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
343
|
-
<div id="
|
342
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000580_source')" id="l_M000580_source">show source</a> ]</p>
|
343
|
+
<div id="M000580_source" class="dyn-source">
|
344
344
|
<pre>
|
345
|
-
<span class="ruby-comment cmt"># File lib/
|
345
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 138</span>
|
346
346
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last</span>(<span class="ruby-identifier">n</span>=<span class="ruby-value">1</span>)
|
347
347
|
<span class="ruby-identifier">n</span> = <span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_i</span>
|
348
348
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">></span> <span class="ruby-identifier">size</span>
|
@@ -354,11 +354,11 @@ Returns <a href="Indexable.html#M000725">last</a> <em>n</em> elements.
|
|
354
354
|
</div>
|
355
355
|
<div class="method">
|
356
356
|
<div class="title">
|
357
|
-
<a name="
|
357
|
+
<a name="M000584"></a><b>last!</b>()
|
358
358
|
</div>
|
359
359
|
<div class="description">
|
360
360
|
<p>
|
361
|
-
Remove and return the <a href="Indexable.html#
|
361
|
+
Remove and return the <a href="Indexable.html#M000580">last</a> element.
|
362
362
|
</p>
|
363
363
|
<pre>
|
364
364
|
a = [1,2,3]
|
@@ -367,10 +367,10 @@ Remove and return the <a href="Indexable.html#M000725">last</a> element.
|
|
367
367
|
</pre>
|
368
368
|
</div>
|
369
369
|
<div class="sourcecode">
|
370
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
371
|
-
<div id="
|
370
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000584_source')" id="l_M000584_source">show source</a> ]</p>
|
371
|
+
<div id="M000584_source" class="dyn-source">
|
372
372
|
<pre>
|
373
|
-
<span class="ruby-comment cmt"># File lib/
|
373
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 180</span>
|
374
374
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last!</span>
|
375
375
|
<span class="ruby-identifier">splice</span>(<span class="ruby-value">-1</span>)
|
376
376
|
<span class="ruby-keyword kw">end</span>
|
@@ -380,11 +380,11 @@ Remove and return the <a href="Indexable.html#M000725">last</a> element.
|
|
380
380
|
</div>
|
381
381
|
<div class="method">
|
382
382
|
<div class="title">
|
383
|
-
<a name="
|
383
|
+
<a name="M000582"></a><b>last=</b>(x)
|
384
384
|
</div>
|
385
385
|
<div class="description">
|
386
386
|
<p>
|
387
|
-
Change the <a href="Indexable.html#
|
387
|
+
Change the <a href="Indexable.html#M000580">last</a> element.
|
388
388
|
</p>
|
389
389
|
<pre>
|
390
390
|
a = [1,2,5]
|
@@ -393,10 +393,10 @@ Change the <a href="Indexable.html#M000725">last</a> element.
|
|
393
393
|
</pre>
|
394
394
|
</div>
|
395
395
|
<div class="sourcecode">
|
396
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
397
|
-
<div id="
|
396
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000582_source')" id="l_M000582_source">show source</a> ]</p>
|
397
|
+
<div id="M000582_source" class="dyn-source">
|
398
398
|
<pre>
|
399
|
-
<span class="ruby-comment cmt"># File lib/
|
399
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 160</span>
|
400
400
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last=</span>(<span class="ruby-identifier">x</span>)
|
401
401
|
<span class="ruby-identifier">splice</span>(<span class="ruby-value">-1</span>,<span class="ruby-identifier">x</span>)
|
402
402
|
<span class="ruby-keyword kw">end</span>
|
@@ -406,16 +406,16 @@ Change the <a href="Indexable.html#M000725">last</a> element.
|
|
406
406
|
</div>
|
407
407
|
<div class="method">
|
408
408
|
<div class="title">
|
409
|
-
<a name="
|
409
|
+
<a name="M000576"></a><b>mid</b>(offset=0)
|
410
410
|
</div>
|
411
411
|
<div class="description">
|
412
412
|
<p>
|
413
|
-
Returns the <a href="Indexable.html#
|
413
|
+
Returns the <a href="Indexable.html#M000577">middle</a> element of an
|
414
414
|
array, or the element offset from <a
|
415
|
-
href="Indexable.html#
|
415
|
+
href="Indexable.html#M000577">middle</a> if the parameter is given.
|
416
416
|
Even-sized arrays, not having an exact <a
|
417
|
-
href="Indexable.html#
|
418
|
-
href="Indexable.html#
|
417
|
+
href="Indexable.html#M000577">middle</a>, return the <a
|
418
|
+
href="Indexable.html#M000577">middle</a>-right element.
|
419
419
|
</p>
|
420
420
|
<pre>
|
421
421
|
[1,2,3,4,5].mid #=> 3
|
@@ -430,10 +430,10 @@ of the two center elements is indexed as orgin (0).
|
|
430
430
|
</p>
|
431
431
|
</div>
|
432
432
|
<div class="sourcecode">
|
433
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
434
|
-
<div id="
|
433
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000576_source')" id="l_M000576_source">show source</a> ]</p>
|
434
|
+
<div id="M000576_source" class="dyn-source">
|
435
435
|
<pre>
|
436
|
-
<span class="ruby-comment cmt"># File lib/
|
436
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 89</span>
|
437
437
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mid</span>(<span class="ruby-identifier">offset</span>=<span class="ruby-value">0</span>)
|
438
438
|
<span class="ruby-identifier">slice</span>((<span class="ruby-identifier">size</span> <span class="ruby-operator">/</span> <span class="ruby-value">2</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">offset</span>)
|
439
439
|
<span class="ruby-keyword kw">end</span>
|
@@ -443,29 +443,29 @@ of the two center elements is indexed as orgin (0).
|
|
443
443
|
</div>
|
444
444
|
<div class="method">
|
445
445
|
<div class="title">
|
446
|
-
<a name="
|
446
|
+
<a name="M000577"></a><b>middle</b>()
|
447
447
|
</div>
|
448
448
|
<div class="description">
|
449
449
|
<p>
|
450
|
-
Returns the <a href="Indexable.html#
|
450
|
+
Returns the <a href="Indexable.html#M000577">middle</a> element(s) of an
|
451
451
|
array. Even-sized arrays, not having an exact <a
|
452
|
-
href="Indexable.html#
|
453
|
-
the two <a href="Indexable.html#
|
452
|
+
href="Indexable.html#M000577">middle</a>, returns a two-element array of
|
453
|
+
the two <a href="Indexable.html#M000577">middle</a> elements.
|
454
454
|
</p>
|
455
455
|
<pre>
|
456
456
|
[1,2,3,4,5].middle #=> 3
|
457
457
|
[1,2,3,4,5,6].middle #=> [3,4]
|
458
458
|
</pre>
|
459
459
|
<p>
|
460
|
-
In contrast to <a href="Indexable.html#
|
460
|
+
In contrast to <a href="Indexable.html#M000576">mid</a> which utilizes an
|
461
461
|
offset.
|
462
462
|
</p>
|
463
463
|
</div>
|
464
464
|
<div class="sourcecode">
|
465
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
466
|
-
<div id="
|
465
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000577_source')" id="l_M000577_source">show source</a> ]</p>
|
466
|
+
<div id="M000577_source" class="dyn-source">
|
467
467
|
<pre>
|
468
|
-
<span class="ruby-comment cmt"># File lib/
|
468
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 102</span>
|
469
469
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">middle</span>
|
470
470
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">size</span> <span class="ruby-operator">%</span> <span class="ruby-value">2</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
471
471
|
<span class="ruby-identifier">slice</span>( (<span class="ruby-identifier">size</span> <span class="ruby-operator">/</span> <span class="ruby-value">2</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>, <span class="ruby-value">2</span> )
|
@@ -480,7 +480,7 @@ offset.
|
|
480
480
|
</div>
|
481
481
|
<div class="method">
|
482
482
|
<div class="title">
|
483
|
-
<a name="
|
483
|
+
<a name="M000586"></a><b>pos</b>(i)
|
484
484
|
</div>
|
485
485
|
<div class="description">
|
486
486
|
<p>
|
@@ -493,10 +493,10 @@ to -1.
|
|
493
493
|
</pre>
|
494
494
|
</div>
|
495
495
|
<div class="sourcecode">
|
496
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
497
|
-
<div id="
|
496
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000586_source')" id="l_M000586_source">show source</a> ]</p>
|
497
|
+
<div id="M000586_source" class="dyn-source">
|
498
498
|
<pre>
|
499
|
-
<span class="ruby-comment cmt"># File lib/
|
499
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 203</span>
|
500
500
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pos</span>(<span class="ruby-identifier">i</span>)
|
501
501
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
502
502
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
@@ -510,15 +510,15 @@ to -1.
|
|
510
510
|
</div>
|
511
511
|
<div class="method">
|
512
512
|
<div class="title">
|
513
|
-
<a name="
|
513
|
+
<a name="M000588"></a><b>range</b>(a=nil,z=nil)
|
514
514
|
</div>
|
515
515
|
<div class="description">
|
516
516
|
<p>
|
517
|
-
Returns the index <a href="Indexable.html#
|
517
|
+
Returns the index <a href="Indexable.html#M000588">range</a> between two
|
518
518
|
elements. If no elements are given, returns the <a
|
519
|
-
href="Indexable.html#
|
520
|
-
href="Indexable.html#
|
521
|
-
href="Indexable.html#
|
519
|
+
href="Indexable.html#M000588">range</a> from <a
|
520
|
+
href="Indexable.html#M000579">first</a> to <a
|
521
|
+
href="Indexable.html#M000580">last</a>.
|
522
522
|
</p>
|
523
523
|
<pre>
|
524
524
|
['a','b','c','d'].range #=> 0..3
|
@@ -526,10 +526,10 @@ href="Indexable.html#M000725">last</a>.
|
|
526
526
|
</pre>
|
527
527
|
</div>
|
528
528
|
<div class="sourcecode">
|
529
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
530
|
-
<div id="
|
529
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000588_source')" id="l_M000588_source">show source</a> ]</p>
|
530
|
+
<div id="M000588_source" class="dyn-source">
|
531
531
|
<pre>
|
532
|
-
<span class="ruby-comment cmt"># File lib/
|
532
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 234</span>
|
533
533
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">range</span>(<span class="ruby-identifier">a</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">z</span>=<span class="ruby-keyword kw">nil</span>)
|
534
534
|
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">a</span>
|
535
535
|
<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-identifier">size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)
|
@@ -543,22 +543,22 @@ href="Indexable.html#M000725">last</a>.
|
|
543
543
|
</div>
|
544
544
|
<div class="method">
|
545
545
|
<div class="title">
|
546
|
-
<a name="
|
546
|
+
<a name="M000573"></a><b>tail</b>()
|
547
547
|
</div>
|
548
548
|
<div class="description">
|
549
549
|
<p>
|
550
550
|
Returns an array from second element to <a
|
551
|
-
href="Indexable.html#
|
551
|
+
href="Indexable.html#M000580">last</a> element.
|
552
552
|
</p>
|
553
553
|
<pre>
|
554
554
|
[1,2,3].tail #=> [2,3]
|
555
555
|
</pre>
|
556
556
|
</div>
|
557
557
|
<div class="sourcecode">
|
558
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
559
|
-
<div id="
|
558
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000573_source')" id="l_M000573_source">show source</a> ]</p>
|
559
|
+
<div id="M000573_source" class="dyn-source">
|
560
560
|
<pre>
|
561
|
-
<span class="ruby-comment cmt"># File lib/
|
561
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 49</span>
|
562
562
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tail</span>
|
563
563
|
<span class="ruby-identifier">slice</span>(<span class="ruby-value">1</span>,<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)
|
564
564
|
<span class="ruby-keyword kw">end</span>
|
@@ -568,11 +568,11 @@ href="Indexable.html#M000725">last</a> element.
|
|
568
568
|
</div>
|
569
569
|
<div class="method">
|
570
570
|
<div class="title">
|
571
|
-
<a name="
|
571
|
+
<a name="M000578"></a><b>thru</b>(from, to)
|
572
572
|
</div>
|
573
573
|
<div class="description">
|
574
574
|
<p>
|
575
|
-
Fetch values from a start index <a href="Indexable.html#
|
575
|
+
Fetch values from a start index <a href="Indexable.html#M000578">thru</a>
|
576
576
|
an end index.
|
577
577
|
</p>
|
578
578
|
<pre>
|
@@ -581,10 +581,10 @@ an end index.
|
|
581
581
|
</pre>
|
582
582
|
</div>
|
583
583
|
<div class="sourcecode">
|
584
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
585
|
-
<div id="
|
584
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000578_source')" id="l_M000578_source">show source</a> ]</p>
|
585
|
+
<div id="M000578_source" class="dyn-source">
|
586
586
|
<pre>
|
587
|
-
<span class="ruby-comment cmt"># File lib/
|
587
|
+
<span class="ruby-comment cmt"># File lib/core/facets/indexable.rb, line 116</span>
|
588
588
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">thru</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>)
|
589
589
|
<span class="ruby-identifier">a</span> = []
|
590
590
|
<span class="ruby-identifier">i</span> = <span class="ruby-identifier">from</span>
|