facets 2.5.2 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.rdoc +2245 -0
- data/MANIFEST +20 -725
- data/{README → README.rdoc} +0 -0
- data/RELEASE +37 -48
- data/doc/log/stats/index.html +39 -0
- data/doc/notes/CHANGES +2529 -0
- data/lib/{more → core}/facets/binding/opvars.rb +0 -0
- data/lib/core/facets/integer/length.rb +16 -0
- data/lib/core/facets/kernel/state.rb +50 -0
- data/lib/core/facets/module/extend.rb +2 -2
- data/lib/core/facets/string/camelcase.rb +33 -9
- data/lib/core/facets/string/lowercase.rb +1 -0
- data/lib/core/facets/string/methodize.rb +10 -1
- data/lib/core/facets/string/modulize.rb +8 -0
- data/lib/core/facets/string/pathize.rb +10 -0
- data/lib/core/facets/string/snakecase.rb +2 -2
- data/lib/core/facets/string/underscore.rb +21 -0
- data/lib/core/facets/string/uppercase.rb +23 -0
- data/lib/more/facets/censor.rb +97 -0
- data/lib/more/facets/minitar.rb +11 -11
- data/lib/more/facets/platform.rb +47 -0
- data/lib/more/facets/pry.rb +32 -0
- data/lib/more/facets/string/obfuscate.rb +65 -0
- data/lib/more/facets/string/stylize.rb +169 -0
- data/lib/more/facets/string/words.rb +10 -13
- data/meta/modified +1 -0
- data/meta/package +1 -0
- data/meta/version +1 -0
- data/test/core/integer/test_length.rb +12 -0
- metadata +41 -822
- data/CHANGES +0 -133
- data/VERSION +0 -1
- data/doc/changelogs/CHANGELOG-0.10.30 +0 -239
- data/doc/changelogs/CHANGELOG-1.8.54 +0 -450
- data/doc/changelogs/CHANGELOG-2.4.5 +0 -1654
- data/doc/rdoc/core/classes/Array.html +0 -1208
- data/doc/rdoc/core/classes/Binding.html +0 -364
- data/doc/rdoc/core/classes/Class.html +0 -444
- data/doc/rdoc/core/classes/Comparable.html +0 -250
- data/doc/rdoc/core/classes/Dir.html +0 -395
- data/doc/rdoc/core/classes/Enumerable.html +0 -1262
- data/doc/rdoc/core/classes/Enumerable/Enumerator.html +0 -243
- data/doc/rdoc/core/classes/Enumerator.html +0 -242
- data/doc/rdoc/core/classes/Exception.html +0 -163
- data/doc/rdoc/core/classes/FalseClass.html +0 -131
- data/doc/rdoc/core/classes/File.html +0 -576
- data/doc/rdoc/core/classes/FileTest.html +0 -116
- data/doc/rdoc/core/classes/Float.html +0 -159
- data/doc/rdoc/core/classes/Functor.html +0 -171
- data/doc/rdoc/core/classes/Hash.html +0 -2184
- data/doc/rdoc/core/classes/Indexable.html +0 -629
- data/doc/rdoc/core/classes/InstanceVariables.html +0 -306
- data/doc/rdoc/core/classes/Integer.html +0 -583
- data/doc/rdoc/core/classes/Kernel.html +0 -2269
- data/doc/rdoc/core/classes/Lazy.html +0 -96
- data/doc/rdoc/core/classes/Lazy/Future.html +0 -100
- data/doc/rdoc/core/classes/Lazy/Promise.html +0 -114
- data/doc/rdoc/core/classes/Lazy/PromiseSafe.html +0 -99
- data/doc/rdoc/core/classes/MatchData.html +0 -204
- data/doc/rdoc/core/classes/Module.html +0 -1316
- data/doc/rdoc/core/classes/NilClass.html +0 -217
- data/doc/rdoc/core/classes/Numeric.html +0 -251
- data/doc/rdoc/core/classes/Object.html +0 -161
- data/doc/rdoc/core/classes/ObjectSpace.html +0 -114
- data/doc/rdoc/core/classes/Proc.html +0 -302
- data/doc/rdoc/core/classes/Range.html +0 -360
- data/doc/rdoc/core/classes/Regexp.html +0 -191
- data/doc/rdoc/core/classes/Stackable.html +0 -262
- data/doc/rdoc/core/classes/String.html +0 -2332
- data/doc/rdoc/core/classes/Struct.html +0 -121
- data/doc/rdoc/core/classes/Symbol.html +0 -441
- data/doc/rdoc/core/classes/Time.html +0 -521
- data/doc/rdoc/core/classes/TrueClass.html +0 -131
- data/doc/rdoc/core/classes/UnboundMethod.html +0 -200
- data/doc/rdoc/core/created.rid +0 -1
- data/doc/rdoc/core/files/README.html +0 -287
- data/doc/rdoc/core/files/doc/README_core.html +0 -230
- data/doc/rdoc/core/files/lib/core/facets/array/combination_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/array/conjoin_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/delete_rb.html +0 -101
- data/doc/rdoc/core/files/lib/core/facets/array/delete_unless_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/delete_values_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/index_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/indexable_rb.html +0 -97
- data/doc/rdoc/core/files/lib/core/facets/array/merge_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/not_empty_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/only_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/pad_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/permutation_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/product_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/recursively_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/rotate_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/select_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/splice_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array/stackable_rb.html +0 -97
- data/doc/rdoc/core/files/lib/core/facets/array/traverse_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/array_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/binding/caller_rb.html +0 -97
- data/doc/rdoc/core/files/lib/core/facets/binding/callstack_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/binding/defined_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/binding/eval_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/binding/local_variables_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/binding/self_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/binding_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/bitmask_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/blank_rb.html +0 -97
- data/doc/rdoc/core/files/lib/core/facets/boolean_rb.html +0 -126
- data/doc/rdoc/core/files/lib/core/facets/cattr_rb.html +0 -100
- data/doc/rdoc/core/files/lib/core/facets/class/cattr_accessor_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/class/cattr_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/class/cattr_reader_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/class/cattr_writer_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/class/descendents_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/class/methodize_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/class/pathize_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/class/prepend_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/class/subclasses_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/class/to_proc_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/class_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/comparable/at_least_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/comparable/at_most_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/comparable/bound_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/comparable/cap_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/comparable/clip_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/comparable/cmp_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/comparable/comparable_rb.html +0 -109
- data/doc/rdoc/core/files/lib/core/facets/comparable_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/dir/ascend_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/dir/descend_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/dir/multiglob_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/dir/parent_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/dir/recurse_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/dir_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/accumulate_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/enumerable/cluster_by_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/enumerable/collect_rb.html +0 -101
- data/doc/rdoc/core/files/lib/core/facets/enumerable/commonality_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/compact_map_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/count_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/divide_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/duplicates_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/each_by_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/enumerable/entropy_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/enumerable/frequency_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/graph_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/enumerable/group_by_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/inject_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/map_send_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/map_with_index_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/mash_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/mode_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/modulate_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/none_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/occur_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/one_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/probability_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/split_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/sum_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/take_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable/uniq_by_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/enumerable_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/exception/detail_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/exception/suppress_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/exception_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/file/append_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/file/create_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/file/null_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/file/read_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/file/rewrite_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/file/rootname_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/file/split_all_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/file/split_root_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/file/write_rb.html +0 -102
- data/doc/rdoc/core/files/lib/core/facets/file/writelines_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/file_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/filetest/root_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/filetest_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/float/round_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/float_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/functor_rb.html +0 -151
- data/doc/rdoc/core/files/lib/core/facets/hash/alias_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/argumentize_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/at_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/autonew_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/collate_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/dearray_values_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/delete_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/diff_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/except_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/group_by_value_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/insert_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/inverse_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/join_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/keys_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/mash_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/hash/merge_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/new_with_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/op_add_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/op_and_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/op_mul_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/op_or_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/op_push_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/op_rb.html +0 -101
- data/doc/rdoc/core/files/lib/core/facets/hash/op_sub_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/recursive_merge_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/recursively_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/rekey_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/hash/replace_each_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/select_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/slice_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/hash/stringify_keys_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/hash/swap_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/symbolize_keys_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/hash/to_h_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/hash/to_options_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/hash/to_proc_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/to_struct_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/traverse_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/update_each_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/update_keys_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/update_rb.html +0 -103
- data/doc/rdoc/core/files/lib/core/facets/hash/update_values_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/weave_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash/zipnew_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/hash_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/indexable_rb.html +0 -113
- data/doc/rdoc/core/files/lib/core/facets/integer/even_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/integer/factorial_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/integer/multiple_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/integer/odd_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/integer/of_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/integer/ordinal_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/integer_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/__callee___rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/kernel/__class___rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/__dir___rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/__get___rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/__here___rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/__method___rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/__set___rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/kernel/as_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/kernel/ask_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/attr_singleton_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/callstack_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/complete_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/constant_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/d_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/deep_copy_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/demo_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/ergo_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/kernel/here_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/in_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/instance_assign_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/instance_class_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/instance_exec_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/instance_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/kernel/instance_send_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/instance_variables_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/maybe_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/not_nil_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/object_class_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/object_hexid_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/object_send_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/p_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/populate_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/qua_class_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/require_all_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/require_local_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/resc_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/respond_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/returning_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/silence_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/singleton_class_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/tap_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/try_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/val_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel/with_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/kernel_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/lazy_rb.html +0 -120
- data/doc/rdoc/core/files/lib/core/facets/matchdata/match_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/matchdata/matchset_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/matchdata_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/metaid_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/abstract_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/alias_accessor_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/alias_method_chain_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/alias_module_function_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/ancestor_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/basename_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/can_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/class_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/conflict_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/extend_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/include_function_module_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/instance_methods_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/integrate_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/module/is_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/methodize_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/module/modspace_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/module_load_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/nesting_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/op_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/pathize_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/module/prepend_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/redefine_method_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/redirect_method_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/rename_method_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/revise_rb.html +0 -99
- data/doc/rdoc/core/files/lib/core/facets/module/spacename_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module/wrap_method_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/module_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/nilclass/ergo_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/nilclass/to_f_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/nilclass_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/numeric/approx_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/numeric/distance_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/numeric/round_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/numeric_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/objectspace/classes_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/objectspace_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/proc/bind_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/proc/compose_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/proc/curry_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/proc/to_method_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/proc/update_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/proc_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/range/combine_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/range/overlap_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/range/to_r_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/range/umbrella_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/range/within_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/range_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/regexp/arity_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/regexp/to_re_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/regexp_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/stackable_rb.html +0 -120
- data/doc/rdoc/core/files/lib/core/facets/string/align_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/bracket_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/bytes_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/camelcase_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/capitalized_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/chars_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/chomp_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/cleave_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/compress_lines_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/contains_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/divide_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/each_char_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/string/each_word_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/string/end_with_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/string/expand_tab_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/file_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/string/fold_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/indent_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/interpolate_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/line_wrap_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/lines_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/margin_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/methodize_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/modulize_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/mscan_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/natcmp_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/nchar_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/op_sub_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/outdent_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/string/pathize_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/range_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/rewrite_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/shatter_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/snakecase_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/splice_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/start_with_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/subtract_rb.html +0 -100
- data/doc/rdoc/core/files/lib/core/facets/string/tab_rb.html +0 -99
- data/doc/rdoc/core/files/lib/core/facets/string/tabto_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/string/titlecase_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/to_re_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/variablize_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/word_wrap_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/words_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string/xor_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/string_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/struct/attributes_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/struct_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/symbol/chomp_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/symbol/generate_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/symbol/not_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/symbol/plain_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/symbol/query_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/symbol/re_s_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/symbol/setter_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/symbol/succ_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/symbol/to_proc_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/symbol/variablize_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/symbol_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/time/advance_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/time/ago_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/time/change_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/time/elapse_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/time/hence_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/time/round_rb.html +0 -96
- data/doc/rdoc/core/files/lib/core/facets/time/set_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/time/stamp_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/time/to_time_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/time/trunc_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/time_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/to_hash_rb.html +0 -97
- data/doc/rdoc/core/files/lib/core/facets/unboundmethod/arguments_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/unboundmethod/name_rb.html +0 -92
- data/doc/rdoc/core/files/lib/core/facets/unboundmethod_rb.html +0 -92
- data/doc/rdoc/core/fr_class_index.html +0 -85
- data/doc/rdoc/core/fr_file_index.html +0 -381
- data/doc/rdoc/core/fr_method_index.html +0 -520
- data/doc/rdoc/core/index.html +0 -26
- data/doc/rdoc/core/rdoc-style.css +0 -177
- data/doc/rdoc/more/classes/ANSICode.html +0 -493
- data/doc/rdoc/more/classes/Advisable.html +0 -269
- data/doc/rdoc/more/classes/Advisable/Method.html +0 -223
- data/doc/rdoc/more/classes/Archive.html +0 -89
- data/doc/rdoc/more/classes/Archive/Tar.html +0 -89
- data/doc/rdoc/more/classes/Archive/Tar/Minitar.html +0 -469
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Input.html +0 -355
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Output.html +0 -216
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Reader.html +0 -283
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Writer.html +0 -378
- data/doc/rdoc/more/classes/Argvector.html +0 -487
- data/doc/rdoc/more/classes/Association.html +0 -319
- data/doc/rdoc/more/classes/Association/Kernel.html +0 -131
- data/doc/rdoc/more/classes/Autoarray.html +0 -166
- data/doc/rdoc/more/classes/BBCode.html +0 -532
- data/doc/rdoc/more/classes/BaseX.html +0 -194
- data/doc/rdoc/more/classes/BiCrypt.html +0 -541
- data/doc/rdoc/more/classes/BinReadable.html +0 -485
- data/doc/rdoc/more/classes/BinReadable/ByteOrder.html +0 -223
- data/doc/rdoc/more/classes/Binding.html +0 -146
- data/doc/rdoc/more/classes/BlankSlate.html +0 -129
- data/doc/rdoc/more/classes/Buildable.html +0 -152
- data/doc/rdoc/more/classes/BuildingBlock.html +0 -360
- data/doc/rdoc/more/classes/Capsule.html +0 -408
- data/doc/rdoc/more/classes/Capsule/MissingFile.html +0 -96
- data/doc/rdoc/more/classes/Cloneable.html +0 -129
- data/doc/rdoc/more/classes/ConsoleUtils.html +0 -238
- data/doc/rdoc/more/classes/Coroutine.html +0 -285
- data/doc/rdoc/more/classes/Crypt.html +0 -275
- data/doc/rdoc/more/classes/CssFilter.html +0 -471
- data/doc/rdoc/more/classes/CssTree.html +0 -149
- data/doc/rdoc/more/classes/Dictionary.html +0 -1255
- data/doc/rdoc/more/classes/Downloader.html +0 -512
- data/doc/rdoc/more/classes/Duration.html +0 -691
- data/doc/rdoc/more/classes/Duration/Numeric.html +0 -389
- data/doc/rdoc/more/classes/Duration/Time.html +0 -124
- data/doc/rdoc/more/classes/Enumerable.html +0 -401
- data/doc/rdoc/more/classes/Enumerable/Elementor.html +0 -170
- data/doc/rdoc/more/classes/Enumerable/Enumerator.html +0 -116
- data/doc/rdoc/more/classes/Enumerable/Filterable.html +0 -246
- data/doc/rdoc/more/classes/EnumerablePass.html +0 -214
- data/doc/rdoc/more/classes/Enumerator.html +0 -95
- data/doc/rdoc/more/classes/Enumerator/Filter.html +0 -104
- data/doc/rdoc/more/classes/Equatable.html +0 -188
- data/doc/rdoc/more/classes/Expirable.html +0 -195
- data/doc/rdoc/more/classes/FileList.html +0 -955
- data/doc/rdoc/more/classes/Fileable.html +0 -178
- data/doc/rdoc/more/classes/Fileable/DSL.html +0 -303
- data/doc/rdoc/more/classes/Hash.html +0 -171
- data/doc/rdoc/more/classes/Hash2Xml.html +0 -105
- data/doc/rdoc/more/classes/Hook.html +0 -162
- data/doc/rdoc/more/classes/HtmlFilter.html +0 -329
- data/doc/rdoc/more/classes/IORedirect.html +0 -220
- data/doc/rdoc/more/classes/InfinityClass.html +0 -448
- data/doc/rdoc/more/classes/InfinityClass/Numeric.html +0 -195
- data/doc/rdoc/more/classes/Ini.html +0 -447
- data/doc/rdoc/more/classes/Instantiable.html +0 -140
- data/doc/rdoc/more/classes/Instantize.html +0 -160
- data/doc/rdoc/more/classes/Interval.html +0 -877
- data/doc/rdoc/more/classes/It.html +0 -185
- data/doc/rdoc/more/classes/LRUCache.html +0 -321
- data/doc/rdoc/more/classes/LRUCache/Item.html +0 -114
- data/doc/rdoc/more/classes/LRUCache/Sentinel.html +0 -100
- data/doc/rdoc/more/classes/LinkedList.html +0 -432
- data/doc/rdoc/more/classes/LinkedList/Node.html +0 -149
- data/doc/rdoc/more/classes/Matcher.html +0 -335
- data/doc/rdoc/more/classes/Matcher/MatchData.html +0 -115
- data/doc/rdoc/more/classes/Memoizer.html +0 -240
- data/doc/rdoc/more/classes/MissingArgument.html +0 -97
- data/doc/rdoc/more/classes/Module.html +0 -1224
- data/doc/rdoc/more/classes/Multiton.html +0 -205
- data/doc/rdoc/more/classes/Multiton/Inclusive.html +0 -93
- data/doc/rdoc/more/classes/Multiton/MetaMethods.html +0 -221
- data/doc/rdoc/more/classes/NackClass.html +0 -98
- data/doc/rdoc/more/classes/Net.html +0 -88
- data/doc/rdoc/more/classes/Net/SMTP.html +0 -140
- data/doc/rdoc/more/classes/NullClass.html +0 -202
- data/doc/rdoc/more/classes/Numeric/Multipliers.html +0 -456
- data/doc/rdoc/more/classes/ObjectReflection.html +0 -172
- data/doc/rdoc/more/classes/OpEsc.html +0 -137
- data/doc/rdoc/more/classes/OpenCascade.html +0 -179
- data/doc/rdoc/more/classes/OpenCollection.html +0 -138
- data/doc/rdoc/more/classes/OpenHash.html +0 -157
- data/doc/rdoc/more/classes/OpenModule.html +0 -135
- data/doc/rdoc/more/classes/OpenObject.html +0 -608
- data/doc/rdoc/more/classes/OpenStructable.html +0 -326
- data/doc/rdoc/more/classes/PQueue.html +0 -607
- data/doc/rdoc/more/classes/Paramix.html +0 -201
- data/doc/rdoc/more/classes/Paramix/Delegator.html +0 -215
- data/doc/rdoc/more/classes/PathList.html +0 -159
- data/doc/rdoc/more/classes/PathList/Finder.html +0 -135
- data/doc/rdoc/more/classes/Platform.html +0 -444
- data/doc/rdoc/more/classes/Pool.html +0 -204
- data/doc/rdoc/more/classes/Proc.html +0 -180
- data/doc/rdoc/more/classes/ProgressBar.html +0 -356
- data/doc/rdoc/more/classes/Prototype.html +0 -243
- data/doc/rdoc/more/classes/RWDelegator.html +0 -194
- data/doc/rdoc/more/classes/Random.html +0 -145
- data/doc/rdoc/more/classes/Random/Array.html +0 -339
- data/doc/rdoc/more/classes/Random/Hash.html +0 -378
- data/doc/rdoc/more/classes/Random/Object.html +0 -119
- data/doc/rdoc/more/classes/Random/String.html +0 -299
- data/doc/rdoc/more/classes/Random/String/Self.html +0 -153
- data/doc/rdoc/more/classes/Recorder.html +0 -203
- data/doc/rdoc/more/classes/Reference.html +0 -196
- data/doc/rdoc/more/classes/Registerable.html +0 -157
- data/doc/rdoc/more/classes/Semaphore.html +0 -260
- data/doc/rdoc/more/classes/Settings.html +0 -288
- data/doc/rdoc/more/classes/Settings/Setting.html +0 -223
- data/doc/rdoc/more/classes/Settings/SettingCollection.html +0 -144
- data/doc/rdoc/more/classes/SimpleStringIO.html +0 -135
- data/doc/rdoc/more/classes/Snapshot.html +0 -194
- data/doc/rdoc/more/classes/Snapshot/ValueHolder.html +0 -163
- data/doc/rdoc/more/classes/SparseArray.html +0 -1397
- data/doc/rdoc/more/classes/Stash.html +0 -232
- data/doc/rdoc/more/classes/String/Mask.html +0 -555
- data/doc/rdoc/more/classes/String/Words.html +0 -328
- data/doc/rdoc/more/classes/Struct.html +0 -130
- data/doc/rdoc/more/classes/SyncArray.html +0 -127
- data/doc/rdoc/more/classes/SyncHash.html +0 -158
- data/doc/rdoc/more/classes/SyncHash/Delegator.html +0 -211
- data/doc/rdoc/more/classes/SyncHash/Inheritor.html +0 -211
- data/doc/rdoc/more/classes/System.html +0 -1117
- data/doc/rdoc/more/classes/Timer.html +0 -464
- data/doc/rdoc/more/classes/Timer/Dummy.html +0 -139
- data/doc/rdoc/more/classes/TracePoint.html +0 -455
- data/doc/rdoc/more/classes/Tuple.html +0 -900
- data/doc/rdoc/more/classes/TypeCast.html +0 -158
- data/doc/rdoc/more/classes/TypeCast/Class.html +0 -127
- data/doc/rdoc/more/classes/TypeCast/Object.html +0 -117
- data/doc/rdoc/more/classes/TypeCastException.html +0 -96
- data/doc/rdoc/more/classes/Uninheritable.html +0 -120
- data/doc/rdoc/more/classes/VersionNumber.html +0 -408
- data/doc/rdoc/more/classes/X.html +0 -117
- data/doc/rdoc/more/classes/XOXO.html +0 -189
- data/doc/rdoc/more/classes/ZipUtils.html +0 -568
- data/doc/rdoc/more/classes/ZipUtils/DryRun.html +0 -391
- data/doc/rdoc/more/classes/ZipUtils/NoWrite.html +0 -391
- data/doc/rdoc/more/classes/ZipUtils/Verbose.html +0 -361
- data/doc/rdoc/more/created.rid +0 -1
- data/doc/rdoc/more/files/README.html +0 -286
- data/doc/rdoc/more/files/doc/README_more.html +0 -141
- data/doc/rdoc/more/files/lib/more/facets/1stclassmethod_rb.html +0 -181
- data/doc/rdoc/more/files/lib/more/facets/advisable_rb.html +0 -124
- data/doc/rdoc/more/files/lib/more/facets/ansicode_rb.html +0 -200
- data/doc/rdoc/more/files/lib/more/facets/argvector_rb.html +0 -142
- data/doc/rdoc/more/files/lib/more/facets/association_rb.html +0 -158
- data/doc/rdoc/more/files/lib/more/facets/attr_rb.html +0 -92
- data/doc/rdoc/more/files/lib/more/facets/autoarray_rb.html +0 -125
- data/doc/rdoc/more/files/lib/more/facets/autoreload_rb.html +0 -134
- data/doc/rdoc/more/files/lib/more/facets/basex_rb.html +0 -92
- data/doc/rdoc/more/files/lib/more/facets/bbcode_rb.html +0 -138
- data/doc/rdoc/more/files/lib/more/facets/bicrypt_rb.html +0 -124
- data/doc/rdoc/more/files/lib/more/facets/binding/opvars_rb.html +0 -96
- data/doc/rdoc/more/files/lib/more/facets/binreadable_rb.html +0 -141
- data/doc/rdoc/more/files/lib/more/facets/blankslate_rb.html +0 -92
- data/doc/rdoc/more/files/lib/more/facets/buildable_rb.html +0 -230
- data/doc/rdoc/more/files/lib/more/facets/capsule_rb.html +0 -143
- data/doc/rdoc/more/files/lib/more/facets/class_extension_rb.html +0 -155
- data/doc/rdoc/more/files/lib/more/facets/classmethods_rb.html +0 -213
- data/doc/rdoc/more/files/lib/more/facets/cloneable_rb.html +0 -134
- data/doc/rdoc/more/files/lib/more/facets/consoleutils_rb.html +0 -92
- data/doc/rdoc/more/files/lib/more/facets/coroutine_rb.html +0 -163
- data/doc/rdoc/more/files/lib/more/facets/crypt_rb.html +0 -141
- data/doc/rdoc/more/files/lib/more/facets/cssfilter_rb.html +0 -121
- data/doc/rdoc/more/files/lib/more/facets/daemonize_rb.html +0 -118
- data/doc/rdoc/more/files/lib/more/facets/dependency_rb.html +0 -158
- data/doc/rdoc/more/files/lib/more/facets/dictionary_rb.html +0 -201
- data/doc/rdoc/more/files/lib/more/facets/downloader_rb.html +0 -137
- data/doc/rdoc/more/files/lib/more/facets/duplicable_rb.html +0 -100
- data/doc/rdoc/more/files/lib/more/facets/duration_rb.html +0 -92
- data/doc/rdoc/more/files/lib/more/facets/elementor_rb.html +0 -149
- data/doc/rdoc/more/files/lib/more/facets/elementwise_rb.html +0 -96
- data/doc/rdoc/more/files/lib/more/facets/enumerablepass_rb.html +0 -154
- data/doc/rdoc/more/files/lib/more/facets/equatable_rb.html +0 -146
- data/doc/rdoc/more/files/lib/more/facets/expirable_rb.html +0 -116
- data/doc/rdoc/more/files/lib/more/facets/fileable_rb.html +0 -138
- data/doc/rdoc/more/files/lib/more/facets/filelist_rb.html +0 -165
- data/doc/rdoc/more/files/lib/more/facets/filter_rb.html +0 -97
- data/doc/rdoc/more/files/lib/more/facets/heap_rb.html +0 -132
- data/doc/rdoc/more/files/lib/more/facets/hook_rb.html +0 -96
- data/doc/rdoc/more/files/lib/more/facets/htmlfilter_rb.html +0 -153
- data/doc/rdoc/more/files/lib/more/facets/infinity_rb.html +0 -153
- data/doc/rdoc/more/files/lib/more/facets/inheritor_rb.html +0 -124
- data/doc/rdoc/more/files/lib/more/facets/ini_rb.html +0 -105
- data/doc/rdoc/more/files/lib/more/facets/instantiable_rb.html +0 -119
- data/doc/rdoc/more/files/lib/more/facets/instantise_rb.html +0 -96
- data/doc/rdoc/more/files/lib/more/facets/instantize_rb.html +0 -160
- data/doc/rdoc/more/files/lib/more/facets/interval_rb.html +0 -163
- data/doc/rdoc/more/files/lib/more/facets/ioredirect_rb.html +0 -133
- data/doc/rdoc/more/files/lib/more/facets/iteration_rb.html +0 -94
- data/doc/rdoc/more/files/lib/more/facets/kernel/meta_rb.html +0 -96
- data/doc/rdoc/more/files/lib/more/facets/linkedlist_rb.html +0 -159
- data/doc/rdoc/more/files/lib/more/facets/lrucache_rb.html +0 -129
- data/doc/rdoc/more/files/lib/more/facets/main_rb.html +0 -126
- data/doc/rdoc/more/files/lib/more/facets/matcher_rb.html +0 -97
- data/doc/rdoc/more/files/lib/more/facets/memoize_rb.html +0 -164
- data/doc/rdoc/more/files/lib/more/facets/memoizer_rb.html +0 -152
- data/doc/rdoc/more/files/lib/more/facets/methodspace_rb.html +0 -138
- data/doc/rdoc/more/files/lib/more/facets/minitar_rb.html +0 -203
- data/doc/rdoc/more/files/lib/more/facets/multipliers_rb.html +0 -132
- data/doc/rdoc/more/files/lib/more/facets/multiton_rb.html +0 -187
- data/doc/rdoc/more/files/lib/more/facets/nackclass_rb.html +0 -120
- data/doc/rdoc/more/files/lib/more/facets/net/smtp_tls_rb.html +0 -143
- data/doc/rdoc/more/files/lib/more/facets/nilstatus_rb.html +0 -92
- data/doc/rdoc/more/files/lib/more/facets/nullclass_rb.html +0 -122
- data/doc/rdoc/more/files/lib/more/facets/opencascade_rb.html +0 -114
- data/doc/rdoc/more/files/lib/more/facets/opencollection_rb.html +0 -123
- data/doc/rdoc/more/files/lib/more/facets/openhash_rb.html +0 -107
- data/doc/rdoc/more/files/lib/more/facets/openmodule_rb.html +0 -92
- data/doc/rdoc/more/files/lib/more/facets/openobject_rb.html +0 -169
- data/doc/rdoc/more/files/lib/more/facets/opesc_rb.html +0 -94
- data/doc/rdoc/more/files/lib/more/facets/orderedhash_rb.html +0 -143
- data/doc/rdoc/more/files/lib/more/facets/ostructable_rb.html +0 -92
- data/doc/rdoc/more/files/lib/more/facets/overload_rb.html +0 -119
- data/doc/rdoc/more/files/lib/more/facets/paramix_rb.html +0 -135
- data/doc/rdoc/more/files/lib/more/facets/partial_rb.html +0 -124
- data/doc/rdoc/more/files/lib/more/facets/pathlist_rb.html +0 -133
- data/doc/rdoc/more/files/lib/more/facets/platform_rb.html +0 -103
- data/doc/rdoc/more/files/lib/more/facets/pool_rb.html +0 -131
- data/doc/rdoc/more/files/lib/more/facets/pqueue_rb.html +0 -128
- data/doc/rdoc/more/files/lib/more/facets/progressbar_rb.html +0 -126
- data/doc/rdoc/more/files/lib/more/facets/prototype_rb.html +0 -102
- data/doc/rdoc/more/files/lib/more/facets/random_rb.html +0 -149
- data/doc/rdoc/more/files/lib/more/facets/rbsystem_rb.html +0 -144
- data/doc/rdoc/more/files/lib/more/facets/recorder_rb.html +0 -154
- data/doc/rdoc/more/files/lib/more/facets/reference_rb.html +0 -130
- data/doc/rdoc/more/files/lib/more/facets/reflection_rb.html +0 -134
- data/doc/rdoc/more/files/lib/more/facets/registerable_rb.html +0 -98
- data/doc/rdoc/more/files/lib/more/facets/rwdelegator_rb.html +0 -122
- data/doc/rdoc/more/files/lib/more/facets/semaphore_rb.html +0 -120
- data/doc/rdoc/more/files/lib/more/facets/settings_rb.html +0 -141
- data/doc/rdoc/more/files/lib/more/facets/snapshot_rb.html +0 -177
- data/doc/rdoc/more/files/lib/more/facets/sparse_array_rb.html +0 -92
- data/doc/rdoc/more/files/lib/more/facets/stash_rb.html +0 -166
- data/doc/rdoc/more/files/lib/more/facets/string/mask_rb.html +0 -96
- data/doc/rdoc/more/files/lib/more/facets/string/words_rb.html +0 -96
- data/doc/rdoc/more/files/lib/more/facets/succ_rb.html +0 -92
- data/doc/rdoc/more/files/lib/more/facets/syncarray_rb.html +0 -125
- data/doc/rdoc/more/files/lib/more/facets/synchash_rb.html +0 -138
- data/doc/rdoc/more/files/lib/more/facets/thread_rb.html +0 -132
- data/doc/rdoc/more/files/lib/more/facets/timer_rb.html +0 -174
- data/doc/rdoc/more/files/lib/more/facets/tracepoint_rb.html +0 -172
- data/doc/rdoc/more/files/lib/more/facets/tuple_rb.html +0 -160
- data/doc/rdoc/more/files/lib/more/facets/typecast_rb.html +0 -215
- data/doc/rdoc/more/files/lib/more/facets/uninheritable_rb.html +0 -129
- data/doc/rdoc/more/files/lib/more/facets/version_rb.html +0 -132
- data/doc/rdoc/more/files/lib/more/facets/xmlhash_rb.html +0 -97
- data/doc/rdoc/more/files/lib/more/facets/xoxo_rb.html +0 -136
- data/doc/rdoc/more/files/lib/more/facets/ziputils_rb.html +0 -105
- data/doc/rdoc/more/fr_class_index.html +0 -185
- data/doc/rdoc/more/fr_file_index.html +0 -156
- data/doc/rdoc/more/fr_method_index.html +0 -1132
- data/doc/rdoc/more/index.html +0 -26
- data/doc/rdoc/more/rdoc-style.css +0 -177
- data/lib/core/facets/kernel/__here__.rb +0 -8
- data/lib/more/facets/buildable.rb +0 -344
- data/lib/more/facets/cssfilter.rb +0 -254
- data/lib/more/facets/htmlfilter.rb +0 -595
- data/lib/more/facets/kernel/meta.rb +0 -32
- data/lib/more/facets/prototype.rb +0 -88
- data/lib/more/facets/rwdelegator.rb +0 -74
@@ -1,1208 +0,0 @@
|
|
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
|
-
<html>
|
6
|
-
<head>
|
7
|
-
<title>Class: Array</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
|
11
|
-
<script language="JavaScript" type="text/javascript">
|
12
|
-
// <![CDATA[
|
13
|
-
|
14
|
-
function toggleSource( id )
|
15
|
-
{
|
16
|
-
var elem
|
17
|
-
var link
|
18
|
-
|
19
|
-
if( document.getElementById )
|
20
|
-
{
|
21
|
-
elem = document.getElementById( id )
|
22
|
-
link = document.getElementById( "l_" + id )
|
23
|
-
}
|
24
|
-
else if ( document.all )
|
25
|
-
{
|
26
|
-
elem = eval( "document.all." + id )
|
27
|
-
link = eval( "document.all.l_" + id )
|
28
|
-
}
|
29
|
-
else
|
30
|
-
return false;
|
31
|
-
|
32
|
-
if( elem.style.display == "block" )
|
33
|
-
{
|
34
|
-
elem.style.display = "none"
|
35
|
-
link.innerHTML = "+"
|
36
|
-
}
|
37
|
-
else
|
38
|
-
{
|
39
|
-
elem.style.display = "block"
|
40
|
-
link.innerHTML = "-"
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
function openCode( url )
|
45
|
-
{
|
46
|
-
window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
|
47
|
-
}
|
48
|
-
// ]]>
|
49
|
-
</script>
|
50
|
-
</head>
|
51
|
-
|
52
|
-
<body>
|
53
|
-
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
54
|
-
<td class="file-title"><span class="file-title-prefix">Class</span><br />Array</td>
|
55
|
-
<td align="right">
|
56
|
-
<table cellspacing="0" cellpadding="2">
|
57
|
-
<tr valign="top">
|
58
|
-
<td>In:</td>
|
59
|
-
<td>
|
60
|
-
<a href="../files/lib/core/facets/to_hash_rb.html">lib/core/facets/to_hash.rb</a>
|
61
|
-
<a href="../files/lib/core/facets/boolean_rb.html">lib/core/facets/boolean.rb</a>
|
62
|
-
<a href="../files/lib/core/facets/string/contains_rb.html">lib/core/facets/string/contains.rb</a>
|
63
|
-
<a href="../files/lib/core/facets/array/product_rb.html">lib/core/facets/array/product.rb</a>
|
64
|
-
<a href="../files/lib/core/facets/array/recursively_rb.html">lib/core/facets/array/recursively.rb</a>
|
65
|
-
<a href="../files/lib/core/facets/array/not_empty_rb.html">lib/core/facets/array/not_empty.rb</a>
|
66
|
-
<a href="../files/lib/core/facets/array/delete_unless_rb.html">lib/core/facets/array/delete_unless.rb</a>
|
67
|
-
<a href="../files/lib/core/facets/array/rotate_rb.html">lib/core/facets/array/rotate.rb</a>
|
68
|
-
<a href="../files/lib/core/facets/array/conjoin_rb.html">lib/core/facets/array/conjoin.rb</a>
|
69
|
-
<a href="../files/lib/core/facets/array/indexable_rb.html">lib/core/facets/array/indexable.rb</a>
|
70
|
-
<a href="../files/lib/core/facets/array/merge_rb.html">lib/core/facets/array/merge.rb</a>
|
71
|
-
<a href="../files/lib/core/facets/array/traverse_rb.html">lib/core/facets/array/traverse.rb</a>
|
72
|
-
<a href="../files/lib/core/facets/array/permutation_rb.html">lib/core/facets/array/permutation.rb</a>
|
73
|
-
<a href="../files/lib/core/facets/array/select_rb.html">lib/core/facets/array/select.rb</a>
|
74
|
-
<a href="../files/lib/core/facets/array/index_rb.html">lib/core/facets/array/index.rb</a>
|
75
|
-
<a href="../files/lib/core/facets/array/only_rb.html">lib/core/facets/array/only.rb</a>
|
76
|
-
<a href="../files/lib/core/facets/array/combination_rb.html">lib/core/facets/array/combination.rb</a>
|
77
|
-
<a href="../files/lib/core/facets/array/delete_values_rb.html">lib/core/facets/array/delete_values.rb</a>
|
78
|
-
<a href="../files/lib/core/facets/array/splice_rb.html">lib/core/facets/array/splice.rb</a>
|
79
|
-
<a href="../files/lib/core/facets/array/stackable_rb.html">lib/core/facets/array/stackable.rb</a>
|
80
|
-
<a href="../files/lib/core/facets/array/pad_rb.html">lib/core/facets/array/pad.rb</a>
|
81
|
-
<a href="../files/lib/core/facets/blank_rb.html">lib/core/facets/blank.rb</a>
|
82
|
-
</td>
|
83
|
-
</tr>
|
84
|
-
<tr>
|
85
|
-
<td>Parent:</td>
|
86
|
-
<td>
|
87
|
-
<a href="Object.html">
|
88
|
-
Object
|
89
|
-
</a>
|
90
|
-
</td>
|
91
|
-
</tr>
|
92
|
-
</table>
|
93
|
-
</td>
|
94
|
-
</tr>
|
95
|
-
</table>
|
96
|
-
<!-- banner header -->
|
97
|
-
|
98
|
-
<div id="bodyContent">
|
99
|
-
<div id="content">
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
<div class="sectiontitle">Methods</div>
|
105
|
-
<span style="padding-right: 5px;"><a href="#M000144">**</a></span>
|
106
|
-
<span style="padding-right: 5px;"><a href="#M000159">combination</a></span>
|
107
|
-
<span style="padding-right: 5px;"><a href="#M000151">conjoin</a></span>
|
108
|
-
<span style="padding-right: 5px;"><a href="#M000148">delete_unless</a></span>
|
109
|
-
<span style="padding-right: 5px;"><a href="#M000160">delete_values</a></span>
|
110
|
-
<span style="padding-right: 5px;"><a href="#M000161">delete_values_at</a></span>
|
111
|
-
<span style="padding-right: 5px;"><a href="#M000157">index</a></span>
|
112
|
-
<span style="padding-right: 5px;"><a href="#M000152">merge!</a></span>
|
113
|
-
<span style="padding-right: 5px;"><a href="#M000147">not_empty?</a></span>
|
114
|
-
<span style="padding-right: 5px;"><a href="#M000158">only</a></span>
|
115
|
-
<span style="padding-right: 5px;"><a href="#M000163">pad</a></span>
|
116
|
-
<span style="padding-right: 5px;"><a href="#M000164">pad!</a></span>
|
117
|
-
<span style="padding-right: 5px;"><a href="#M000155">permutation</a></span>
|
118
|
-
<span style="padding-right: 5px;"><a href="#M000143">product</a></span>
|
119
|
-
<span style="padding-right: 5px;"><a href="#M000145">recursively</a></span>
|
120
|
-
<span style="padding-right: 5px;"><a href="#M000146">recursively!</a></span>
|
121
|
-
<span style="padding-right: 5px;"><a href="#M000149">rotate</a></span>
|
122
|
-
<span style="padding-right: 5px;"><a href="#M000150">rotate!</a></span>
|
123
|
-
<span style="padding-right: 5px;"><a href="#M000156">select!</a></span>
|
124
|
-
<span style="padding-right: 5px;"><a href="#M000162">splice</a></span>
|
125
|
-
<span style="padding-right: 5px;"><a href="#M000142">to_b</a></span>
|
126
|
-
<span style="padding-right: 5px;"><a href="#M000136">to_h</a></span>
|
127
|
-
<span style="padding-right: 5px;"><a href="#M000140">to_h_assoc</a></span>
|
128
|
-
<span style="padding-right: 5px;"><a href="#M000137">to_h_auto</a></span>
|
129
|
-
<span style="padding-right: 5px;"><a href="#M000139">to_h_flat</a></span>
|
130
|
-
<span style="padding-right: 5px;"><a href="#M000141">to_h_multi</a></span>
|
131
|
-
<span style="padding-right: 5px;"><a href="#M000138">to_h_splat</a></span>
|
132
|
-
<span style="padding-right: 5px;"><a href="#M000153">traverse</a></span>
|
133
|
-
<span style="padding-right: 5px;"><a href="#M000154">traverse!</a></span>
|
134
|
-
|
135
|
-
<div class="sectiontitle">Included Modules</div>
|
136
|
-
<ul>
|
137
|
-
<li><a href="Indexable.html">Indexable</a></li>
|
138
|
-
<li><a href="Stackable.html">Stackable</a></li>
|
139
|
-
</ul>
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<div class="sectiontitle">Public Instance methods</div>
|
146
|
-
<div class="method">
|
147
|
-
<div class="title">
|
148
|
-
<a name="M000144"></a><b>**</b>(*enums)
|
149
|
-
</div>
|
150
|
-
<div class="description">
|
151
|
-
<p>
|
152
|
-
Alias for <a href="Array.html#M000143">product</a>
|
153
|
-
</p>
|
154
|
-
</div>
|
155
|
-
</div>
|
156
|
-
<div class="method">
|
157
|
-
<div class="title">
|
158
|
-
<a name="M000159"></a><b>combination</b>(k=2) {|s.values_at(*idx)| ...}
|
159
|
-
</div>
|
160
|
-
<div class="description">
|
161
|
-
<p>
|
162
|
-
Yields the block to each unique <a
|
163
|
-
href="Array.html#M000159">combination</a> of <em>n</em> elements.
|
164
|
-
</p>
|
165
|
-
<pre>
|
166
|
-
a = %w|a b c d|
|
167
|
-
a.combination(3)
|
168
|
-
</pre>
|
169
|
-
<p>
|
170
|
-
produces
|
171
|
-
</p>
|
172
|
-
<pre>
|
173
|
-
[["a", "b", "c"],
|
174
|
-
["a", "b", "d"],
|
175
|
-
["a", "c", "d"],
|
176
|
-
["b", "c", "d"]]
|
177
|
-
</pre>
|
178
|
-
<p>
|
179
|
-
CREDIT: Florian Gross
|
180
|
-
</p>
|
181
|
-
</div>
|
182
|
-
<div class="sourcecode">
|
183
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000159_source')" id="l_M000159_source">+</a> ]</p>
|
184
|
-
<div id="M000159_source" class="dyn-source">
|
185
|
-
<pre>
|
186
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/combination.rb, line 21</span>
|
187
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">combination</span>(<span class="ruby-identifier">k</span>=<span class="ruby-value">2</span>)
|
188
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
189
|
-
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">to_a</span>
|
190
|
-
<span class="ruby-identifier">n</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">size</span>
|
191
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> (<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-identifier">n</span>) <span class="ruby-operator">===</span> <span class="ruby-identifier">k</span>
|
192
|
-
<span class="ruby-identifier">idx</span> = (<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">k</span>).<span class="ruby-identifier">to_a</span>
|
193
|
-
<span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
|
194
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">values_at</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">idx</span>)
|
195
|
-
<span class="ruby-identifier">i</span> = <span class="ruby-identifier">k</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
196
|
-
<span class="ruby-identifier">i</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">idx</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">i</span>
|
197
|
-
<span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
198
|
-
<span class="ruby-identifier">idx</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
199
|
-
(<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-operator">...</span> <span class="ruby-identifier">k</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span> <span class="ruby-identifier">idx</span>[<span class="ruby-identifier">j</span>] = <span class="ruby-identifier">idx</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">j</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">i</span>}
|
200
|
-
<span class="ruby-keyword kw">end</span>
|
201
|
-
<span class="ruby-keyword kw">else</span>
|
202
|
-
<span class="ruby-identifier">to_enum</span>(<span class="ruby-identifier">:combination</span>, <span class="ruby-identifier">k</span>)
|
203
|
-
<span class="ruby-keyword kw">end</span>
|
204
|
-
<span class="ruby-keyword kw">end</span>
|
205
|
-
</pre>
|
206
|
-
</div>
|
207
|
-
</div>
|
208
|
-
</div>
|
209
|
-
<div class="method">
|
210
|
-
<div class="title">
|
211
|
-
<a name="M000151"></a><b>conjoin</b>(*args) {|i, *slice(i,2)| ...}
|
212
|
-
</div>
|
213
|
-
<div class="description">
|
214
|
-
<p>
|
215
|
-
This is more advnaced form of join. It allows for fine control of
|
216
|
-
separators.
|
217
|
-
</p>
|
218
|
-
<p>
|
219
|
-
NOTE: The old version used to default it‘s separator to ",
|
220
|
-
" and default the terminating separator to " and ". This is
|
221
|
-
no longer the case. You must specifically provide these parameters.
|
222
|
-
</p>
|
223
|
-
<pre>
|
224
|
-
[1,2,3].conjoin
|
225
|
-
=> "123"
|
226
|
-
|
227
|
-
[1,2,3].conjoin(', ', ' and ')
|
228
|
-
=> "1, 2 and 3
|
229
|
-
|
230
|
-
[1,2,3].conjoin(', ', :last => ' or ')
|
231
|
-
=> "1, 2 or 3
|
232
|
-
|
233
|
-
[1,2,3].conjoin('; ', -1 => ' & ')
|
234
|
-
=> "1; 2 & 3
|
235
|
-
|
236
|
-
[1,2,3,4].conjoin{ |i, a, b| i % 2 == 0 ? '.' : '-' }
|
237
|
-
=> "1.2-3.4"
|
238
|
-
|
239
|
-
[1,1,2,2].conjoin{ |i, a, b| a == b ? '=' : '!=' }
|
240
|
-
=> "1=1!=2=2"
|
241
|
-
</pre>
|
242
|
-
<p>
|
243
|
-
CREDIT: Trans
|
244
|
-
</p>
|
245
|
-
</div>
|
246
|
-
<div class="sourcecode">
|
247
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000151_source')" id="l_M000151_source">+</a> ]</p>
|
248
|
-
<div id="M000151_source" class="dyn-source">
|
249
|
-
<pre>
|
250
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/conjoin.rb, line 30</span>
|
251
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">conjoin</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
252
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">size</span> <span class="ruby-operator"><</span> <span class="ruby-value">2</span>
|
253
|
-
|
254
|
-
<span class="ruby-identifier">sep</span> = []
|
255
|
-
|
256
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
257
|
-
(<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
258
|
-
<span class="ruby-identifier">sep</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">i</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">slice</span>(<span class="ruby-identifier">i</span>,<span class="ruby-value">2</span>))
|
259
|
-
<span class="ruby-keyword kw">end</span>
|
260
|
-
<span class="ruby-keyword kw">else</span>
|
261
|
-
<span class="ruby-identifier">options</span> = (<span class="ruby-constant">Hash</span><span class="ruby-operator">===</span><span class="ruby-identifier">args</span>.<span class="ruby-identifier">last</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> {}
|
262
|
-
<span class="ruby-identifier">separator</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span> <span class="ruby-operator">||</span> <span class="ruby-value str">""</span>
|
263
|
-
<span class="ruby-identifier">options</span>[<span class="ruby-value">-1</span>] = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
|
264
|
-
|
265
|
-
<span class="ruby-identifier">sep</span> = [<span class="ruby-identifier">separator</span>] <span class="ruby-operator">*</span> (<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
|
266
|
-
|
267
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">:last</span>)
|
268
|
-
<span class="ruby-identifier">options</span>[<span class="ruby-value">-1</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:last</span>)
|
269
|
-
<span class="ruby-keyword kw">end</span>
|
270
|
-
|
271
|
-
<span class="ruby-identifier">options</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">" and "</span>
|
272
|
-
|
273
|
-
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span>, <span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">sep</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-identifier">s</span>}
|
274
|
-
<span class="ruby-keyword kw">end</span>
|
275
|
-
<span class="ruby-identifier">zip</span>(<span class="ruby-identifier">sep</span>).<span class="ruby-identifier">join</span>
|
276
|
-
<span class="ruby-keyword kw">end</span>
|
277
|
-
</pre>
|
278
|
-
</div>
|
279
|
-
</div>
|
280
|
-
</div>
|
281
|
-
<div class="method">
|
282
|
-
<div class="title">
|
283
|
-
<a name="M000148"></a><b>delete_unless</b>(&block)
|
284
|
-
</div>
|
285
|
-
<div class="description">
|
286
|
-
<p>
|
287
|
-
Inverse of delete_if.
|
288
|
-
</p>
|
289
|
-
<pre>
|
290
|
-
[1,2,3].delete_unless{ |x| x < 2 }
|
291
|
-
=> [1,2]
|
292
|
-
</pre>
|
293
|
-
<p>
|
294
|
-
CREDIT: Daniel Schierbeck
|
295
|
-
</p>
|
296
|
-
</div>
|
297
|
-
<div class="sourcecode">
|
298
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000148_source')" id="l_M000148_source">+</a> ]</p>
|
299
|
-
<div id="M000148_source" class="dyn-source">
|
300
|
-
<pre>
|
301
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/delete_unless.rb, line 10</span>
|
302
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_unless</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
303
|
-
<span class="ruby-identifier">delete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">element</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">element</span>) }
|
304
|
-
<span class="ruby-keyword kw">end</span>
|
305
|
-
</pre>
|
306
|
-
</div>
|
307
|
-
</div>
|
308
|
-
</div>
|
309
|
-
<div class="method">
|
310
|
-
<div class="title">
|
311
|
-
<a name="M000160"></a><b>delete_values</b>(*values)
|
312
|
-
</div>
|
313
|
-
<div class="description">
|
314
|
-
<p>
|
315
|
-
Delete multiple values from array.
|
316
|
-
</p>
|
317
|
-
<pre>
|
318
|
-
a = [1,2,3,4]
|
319
|
-
a.delete_values(1,2) #=> [1,2]
|
320
|
-
a #=> [3,4]
|
321
|
-
</pre>
|
322
|
-
<p>
|
323
|
-
CREDIT: Trans
|
324
|
-
</p>
|
325
|
-
</div>
|
326
|
-
<div class="sourcecode">
|
327
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000160_source')" id="l_M000160_source">+</a> ]</p>
|
328
|
-
<div id="M000160_source" class="dyn-source">
|
329
|
-
<pre>
|
330
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/delete_values.rb, line 11</span>
|
331
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_values</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">values</span>)
|
332
|
-
<span class="ruby-identifier">d</span> = []
|
333
|
-
<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">d</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">v</span>) }
|
334
|
-
<span class="ruby-identifier">d</span>
|
335
|
-
<span class="ruby-keyword kw">end</span>
|
336
|
-
</pre>
|
337
|
-
</div>
|
338
|
-
</div>
|
339
|
-
</div>
|
340
|
-
<div class="method">
|
341
|
-
<div class="title">
|
342
|
-
<a name="M000161"></a><b>delete_values_at</b>(*selectors)
|
343
|
-
</div>
|
344
|
-
<div class="description">
|
345
|
-
<p>
|
346
|
-
Delete multiple values from array given indexes or <a
|
347
|
-
href="Array.html#M000157">index</a> range.
|
348
|
-
</p>
|
349
|
-
<pre>
|
350
|
-
a = [1,2,3,4]
|
351
|
-
a.delete_values_at(1,2) #=> [2,3]
|
352
|
-
a #=> [1,4]
|
353
|
-
a = [1,2,3,4]
|
354
|
-
a.delete_values_at(0..2) #=> [1,2,3]
|
355
|
-
a #=> [4]
|
356
|
-
</pre>
|
357
|
-
<p>
|
358
|
-
NOTE: It would be nice to see delete_at incorporate this funcitonaility.
|
359
|
-
</p>
|
360
|
-
<p>
|
361
|
-
CREDIT: Trans
|
362
|
-
</p>
|
363
|
-
</div>
|
364
|
-
<div class="sourcecode">
|
365
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000161_source')" id="l_M000161_source">+</a> ]</p>
|
366
|
-
<div id="M000161_source" class="dyn-source">
|
367
|
-
<pre>
|
368
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/delete_values.rb, line 32</span>
|
369
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_values_at</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">selectors</span>)
|
370
|
-
<span class="ruby-identifier">idx</span> = []
|
371
|
-
<span class="ruby-identifier">selectors</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
372
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">i</span>
|
373
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">Range</span>
|
374
|
-
<span class="ruby-identifier">idx</span>.<span class="ruby-identifier">concat</span>( <span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_a</span> )
|
375
|
-
<span class="ruby-keyword kw">else</span>
|
376
|
-
<span class="ruby-identifier">idx</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_i</span>
|
377
|
-
<span class="ruby-keyword kw">end</span>
|
378
|
-
}
|
379
|
-
<span class="ruby-identifier">idx</span>.<span class="ruby-identifier">uniq!</span>
|
380
|
-
<span class="ruby-identifier">dvals</span> = <span class="ruby-identifier">values_at</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">idx</span>)
|
381
|
-
<span class="ruby-identifier">idx</span> = (<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">size</span>).<span class="ruby-identifier">to_a</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">idx</span>
|
382
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">replace</span>( <span class="ruby-identifier">values_at</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">idx</span>) )
|
383
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">dvals</span>
|
384
|
-
<span class="ruby-keyword kw">end</span>
|
385
|
-
</pre>
|
386
|
-
</div>
|
387
|
-
</div>
|
388
|
-
</div>
|
389
|
-
<div class="method">
|
390
|
-
<div class="title">
|
391
|
-
<a name="M000157"></a><b>index</b>(obj=nil, &block)
|
392
|
-
</div>
|
393
|
-
<div class="description">
|
394
|
-
<p>
|
395
|
-
Allows <a href="Array.html#M000157">index</a> to accept a block.
|
396
|
-
</p>
|
397
|
-
<p>
|
398
|
-
OVERRIDE! This is one of the bery few core overrides in Facets.
|
399
|
-
</p>
|
400
|
-
</div>
|
401
|
-
<div class="sourcecode">
|
402
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000157_source')" id="l_M000157_source">+</a> ]</p>
|
403
|
-
<div id="M000157_source" class="dyn-source">
|
404
|
-
<pre>
|
405
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/index.rb, line 12</span>
|
406
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span>(<span class="ruby-identifier">obj</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
407
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
408
|
-
<span class="ruby-identifier">_facets_index</span>(<span class="ruby-identifier">find</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>))
|
409
|
-
<span class="ruby-keyword kw">else</span>
|
410
|
-
<span class="ruby-identifier">_facets_index</span>(<span class="ruby-identifier">obj</span>)
|
411
|
-
<span class="ruby-keyword kw">end</span>
|
412
|
-
<span class="ruby-keyword kw">end</span>
|
413
|
-
</pre>
|
414
|
-
</div>
|
415
|
-
</div>
|
416
|
-
</div>
|
417
|
-
<div class="method">
|
418
|
-
<div class="title">
|
419
|
-
<a name="M000152"></a><b>merge!</b>( other )
|
420
|
-
</div>
|
421
|
-
<div class="description">
|
422
|
-
<p>
|
423
|
-
In place merge.
|
424
|
-
</p>
|
425
|
-
<pre>
|
426
|
-
a = [1,2]
|
427
|
-
a.merge! [2,3]
|
428
|
-
a => [1,2,3]
|
429
|
-
</pre>
|
430
|
-
<p>
|
431
|
-
CREDIT: Trans
|
432
|
-
</p>
|
433
|
-
</div>
|
434
|
-
<div class="sourcecode">
|
435
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000152_source')" id="l_M000152_source">+</a> ]</p>
|
436
|
-
<div id="M000152_source" class="dyn-source">
|
437
|
-
<pre>
|
438
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/merge.rb, line 11</span>
|
439
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">merge!</span>( <span class="ruby-identifier">other</span> )
|
440
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">replace</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">other</span>))
|
441
|
-
<span class="ruby-keyword kw">end</span>
|
442
|
-
</pre>
|
443
|
-
</div>
|
444
|
-
</div>
|
445
|
-
</div>
|
446
|
-
<div class="method">
|
447
|
-
<div class="title">
|
448
|
-
<a name="M000147"></a><b>not_empty?</b>()
|
449
|
-
</div>
|
450
|
-
<div class="description">
|
451
|
-
<p>
|
452
|
-
Not empty?
|
453
|
-
</p>
|
454
|
-
<pre>
|
455
|
-
[].not_empty? #=> false
|
456
|
-
[1,2].not_empty? #=> true
|
457
|
-
</pre>
|
458
|
-
</div>
|
459
|
-
<div class="sourcecode">
|
460
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000147_source')" id="l_M000147_source">+</a> ]</p>
|
461
|
-
<div id="M000147_source" class="dyn-source">
|
462
|
-
<pre>
|
463
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/not_empty.rb, line 8</span>
|
464
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">not_empty?</span>
|
465
|
-
<span class="ruby-operator">!</span><span class="ruby-identifier">empty?</span>
|
466
|
-
<span class="ruby-keyword kw">end</span>
|
467
|
-
</pre>
|
468
|
-
</div>
|
469
|
-
</div>
|
470
|
-
</div>
|
471
|
-
<div class="method">
|
472
|
-
<div class="title">
|
473
|
-
<a name="M000158"></a><b>only</b>()
|
474
|
-
</div>
|
475
|
-
<div class="description">
|
476
|
-
<p>
|
477
|
-
Returns the <em><a href="Array.html#M000158">only</a></em> element in the
|
478
|
-
array. Raises an IndexError if the array‘s size is not 1.
|
479
|
-
</p>
|
480
|
-
<pre>
|
481
|
-
[5].only # -> 5
|
482
|
-
[1,2,3].only # -> IndexError
|
483
|
-
[].only # -> IndexError
|
484
|
-
</pre>
|
485
|
-
<p>
|
486
|
-
CREDIT: Gavin Sinclair, Noah Gibbs
|
487
|
-
</p>
|
488
|
-
</div>
|
489
|
-
<div class="sourcecode">
|
490
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000158_source')" id="l_M000158_source">+</a> ]</p>
|
491
|
-
<div id="M000158_source" class="dyn-source">
|
492
|
-
<pre>
|
493
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/only.rb, line 12</span>
|
494
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">only</span>
|
495
|
-
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
496
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">IndexError</span>, <span class="ruby-value str">"Array#only called on non-single-element array"</span>
|
497
|
-
<span class="ruby-keyword kw">end</span>
|
498
|
-
<span class="ruby-identifier">first</span>
|
499
|
-
<span class="ruby-keyword kw">end</span>
|
500
|
-
</pre>
|
501
|
-
</div>
|
502
|
-
</div>
|
503
|
-
</div>
|
504
|
-
<div class="method">
|
505
|
-
<div class="title">
|
506
|
-
<a name="M000163"></a><b>pad</b>(len, val=nil)
|
507
|
-
</div>
|
508
|
-
<div class="description">
|
509
|
-
<p>
|
510
|
-
Pad an array with a given <tt>value</tt> upto a given <tt>length</tt>.
|
511
|
-
</p>
|
512
|
-
<pre>
|
513
|
-
[0,1,2].pad(6,"a") #=> [0,1,2,"a","a","a"]
|
514
|
-
</pre>
|
515
|
-
<p>
|
516
|
-
If <tt>length</tt> is a negative number padding will be added to the
|
517
|
-
beginning of the array.
|
518
|
-
</p>
|
519
|
-
<pre>
|
520
|
-
[0,1,2].pad(-6,"a") #=> ["a","a","a",0,1,2]
|
521
|
-
</pre>
|
522
|
-
<p>
|
523
|
-
CREDIT: Richard Laugesen
|
524
|
-
</p>
|
525
|
-
</div>
|
526
|
-
<div class="sourcecode">
|
527
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000163_source')" id="l_M000163_source">+</a> ]</p>
|
528
|
-
<div id="M000163_source" class="dyn-source">
|
529
|
-
<pre>
|
530
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/pad.rb, line 14</span>
|
531
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pad</span>(<span class="ruby-identifier">len</span>, <span class="ruby-identifier">val</span>=<span class="ruby-keyword kw">nil</span>)
|
532
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">dup</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">len</span>.<span class="ruby-identifier">abs</span>
|
533
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">len</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
534
|
-
<span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>((<span class="ruby-identifier">len</span><span class="ruby-operator">+</span><span class="ruby-identifier">size</span>).<span class="ruby-identifier">abs</span>,<span class="ruby-identifier">val</span>) <span class="ruby-operator">+</span> <span class="ruby-keyword kw">self</span>
|
535
|
-
<span class="ruby-keyword kw">else</span>
|
536
|
-
<span class="ruby-keyword kw">self</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">len</span><span class="ruby-operator">-</span><span class="ruby-identifier">size</span>,<span class="ruby-identifier">val</span>)
|
537
|
-
<span class="ruby-keyword kw">end</span>
|
538
|
-
<span class="ruby-keyword kw">end</span>
|
539
|
-
</pre>
|
540
|
-
</div>
|
541
|
-
</div>
|
542
|
-
</div>
|
543
|
-
<div class="method">
|
544
|
-
<div class="title">
|
545
|
-
<a name="M000164"></a><b>pad!</b>(len, val=nil)
|
546
|
-
</div>
|
547
|
-
<div class="description">
|
548
|
-
<p>
|
549
|
-
Like <a href="Array.html#M000163">pad</a> but changes the array in place.
|
550
|
-
</p>
|
551
|
-
<pre>
|
552
|
-
a = [0,1,2]
|
553
|
-
a.pad!(6,"x")
|
554
|
-
a #=> [0,1,2,"x","x","x"]
|
555
|
-
</pre>
|
556
|
-
<p>
|
557
|
-
CREDIT: Richard Laugesen
|
558
|
-
</p>
|
559
|
-
</div>
|
560
|
-
<div class="sourcecode">
|
561
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000164_source')" id="l_M000164_source">+</a> ]</p>
|
562
|
-
<div id="M000164_source" class="dyn-source">
|
563
|
-
<pre>
|
564
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/pad.rb, line 31</span>
|
565
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pad!</span>(<span class="ruby-identifier">len</span>, <span class="ruby-identifier">val</span>=<span class="ruby-keyword kw">nil</span>)
|
566
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">len</span>.<span class="ruby-identifier">abs</span>
|
567
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">len</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
568
|
-
<span class="ruby-identifier">replace</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>((<span class="ruby-identifier">len</span><span class="ruby-operator">+</span><span class="ruby-identifier">size</span>).<span class="ruby-identifier">abs</span>,<span class="ruby-identifier">val</span>) <span class="ruby-operator">+</span> <span class="ruby-keyword kw">self</span>
|
569
|
-
<span class="ruby-keyword kw">else</span>
|
570
|
-
<span class="ruby-identifier">concat</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">len</span><span class="ruby-operator">-</span><span class="ruby-identifier">size</span>,<span class="ruby-identifier">val</span>)
|
571
|
-
<span class="ruby-keyword kw">end</span>
|
572
|
-
<span class="ruby-keyword kw">end</span>
|
573
|
-
</pre>
|
574
|
-
</div>
|
575
|
-
</div>
|
576
|
-
</div>
|
577
|
-
<div class="method">
|
578
|
-
<div class="title">
|
579
|
-
<a name="M000155"></a><b>permutation</b>(n=size) {|[]| ...}
|
580
|
-
</div>
|
581
|
-
<div class="description">
|
582
|
-
<p>
|
583
|
-
Permutation provids the possible orders of an enumerable. Each is indexed
|
584
|
-
by a <a href="Array.html#M000155">permutation</a> number. The maximum
|
585
|
-
number of arrangements is the factorial of the size of the array.
|
586
|
-
</p>
|
587
|
-
<p>
|
588
|
-
CREDIT: Shin-ichiro Hara
|
589
|
-
</p>
|
590
|
-
</div>
|
591
|
-
<div class="sourcecode">
|
592
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000155_source')" id="l_M000155_source">+</a> ]</p>
|
593
|
-
<div id="M000155_source" class="dyn-source">
|
594
|
-
<pre>
|
595
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/permutation.rb, line 11</span>
|
596
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">permutation</span>(<span class="ruby-identifier">n</span>=<span class="ruby-identifier">size</span>)
|
597
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">size</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">n</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">n</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
598
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
599
|
-
<span class="ruby-keyword kw">yield</span>([])
|
600
|
-
<span class="ruby-keyword kw">else</span>
|
601
|
-
<span class="ruby-keyword kw">self</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>].<span class="ruby-identifier">permutation</span>(<span class="ruby-identifier">n</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
|
602
|
-
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">n</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
603
|
-
<span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">x</span>[<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">i</span>] <span class="ruby-operator">+</span> [<span class="ruby-identifier">first</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">x</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>])
|
604
|
-
<span class="ruby-keyword kw">end</span>
|
605
|
-
<span class="ruby-keyword kw">end</span>
|
606
|
-
<span class="ruby-keyword kw">self</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>].<span class="ruby-identifier">permutation</span>(<span class="ruby-identifier">n</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
|
607
|
-
<span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">x</span>)
|
608
|
-
<span class="ruby-keyword kw">end</span>
|
609
|
-
<span class="ruby-keyword kw">end</span>
|
610
|
-
<span class="ruby-keyword kw">end</span>
|
611
|
-
</pre>
|
612
|
-
</div>
|
613
|
-
</div>
|
614
|
-
</div>
|
615
|
-
<div class="method">
|
616
|
-
<div class="title">
|
617
|
-
<a name="M000143"></a><b>product</b>(*enums)
|
618
|
-
</div>
|
619
|
-
<div class="description">
|
620
|
-
<p>
|
621
|
-
Provides the cartesian <a href="Array.html#M000143">product</a> of two or
|
622
|
-
more arrays.
|
623
|
-
</p>
|
624
|
-
<pre>
|
625
|
-
a = []
|
626
|
-
[1,2].product([4,5])
|
627
|
-
a #=> [[1, 4],[1, 5],[2, 4],[2, 5]]
|
628
|
-
</pre>
|
629
|
-
<p>
|
630
|
-
CREDIT: Thomas Hafner
|
631
|
-
</p>
|
632
|
-
</div>
|
633
|
-
<div class="aka">
|
634
|
-
This method is also aliased as
|
635
|
-
<a href="Array.html#M000144">**</a>
|
636
|
-
</div>
|
637
|
-
<div class="sourcecode">
|
638
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000143_source')" id="l_M000143_source">+</a> ]</p>
|
639
|
-
<div id="M000143_source" class="dyn-source">
|
640
|
-
<pre>
|
641
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/product.rb, line 13</span>
|
642
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">product</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">enums</span>)
|
643
|
-
<span class="ruby-identifier">enums</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-keyword kw">self</span>
|
644
|
-
<span class="ruby-identifier">result</span> = [[]]
|
645
|
-
<span class="ruby-keyword kw">while</span> [] <span class="ruby-operator">!=</span> <span class="ruby-identifier">enums</span>
|
646
|
-
<span class="ruby-identifier">t</span>, <span class="ruby-identifier">result</span> = <span class="ruby-identifier">result</span>, []
|
647
|
-
<span class="ruby-identifier">b</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">enums</span> = <span class="ruby-identifier">enums</span>
|
648
|
-
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
649
|
-
<span class="ruby-identifier">b</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span>
|
650
|
-
<span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">a</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">n</span>]
|
651
|
-
<span class="ruby-keyword kw">end</span>
|
652
|
-
<span class="ruby-keyword kw">end</span>
|
653
|
-
<span class="ruby-keyword kw">end</span>
|
654
|
-
<span class="ruby-identifier">result</span>
|
655
|
-
<span class="ruby-keyword kw">end</span>
|
656
|
-
</pre>
|
657
|
-
</div>
|
658
|
-
</div>
|
659
|
-
</div>
|
660
|
-
<div class="method">
|
661
|
-
<div class="title">
|
662
|
-
<a name="M000145"></a><b>recursively</b>() {|a| ...}
|
663
|
-
</div>
|
664
|
-
<div class="description">
|
665
|
-
<p>
|
666
|
-
Apply a block to hash, and <a href="Array.html#M000145">recursively</a>
|
667
|
-
apply that block to each subhash.
|
668
|
-
</p>
|
669
|
-
<pre>
|
670
|
-
arr = ["a", ["b", "c", nil], nil]
|
671
|
-
arr.recursively{|a| a.compact! }
|
672
|
-
=> ["a", ["b", "c"]]
|
673
|
-
</pre>
|
674
|
-
<p>
|
675
|
-
TODO: Can this be generalized in Enumerbale?
|
676
|
-
</p>
|
677
|
-
</div>
|
678
|
-
<div class="sourcecode">
|
679
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000145_source')" id="l_M000145_source">+</a> ]</p>
|
680
|
-
<div id="M000145_source" class="dyn-source">
|
681
|
-
<pre>
|
682
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/recursively.rb, line 12</span>
|
683
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">recursively</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
684
|
-
<span class="ruby-identifier">a</span> = <span class="ruby-identifier">inject</span>([]) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">array</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
685
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
686
|
-
<span class="ruby-identifier">array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">recursively</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
687
|
-
<span class="ruby-keyword kw">else</span>
|
688
|
-
<span class="ruby-identifier">array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">value</span>
|
689
|
-
<span class="ruby-keyword kw">end</span>
|
690
|
-
<span class="ruby-identifier">array</span>
|
691
|
-
<span class="ruby-keyword kw">end</span>
|
692
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">a</span>
|
693
|
-
<span class="ruby-keyword kw">end</span>
|
694
|
-
</pre>
|
695
|
-
</div>
|
696
|
-
</div>
|
697
|
-
</div>
|
698
|
-
<div class="method">
|
699
|
-
<div class="title">
|
700
|
-
<a name="M000146"></a><b>recursively!</b>(&block)
|
701
|
-
</div>
|
702
|
-
<div class="description">
|
703
|
-
<p>
|
704
|
-
In place form of <a href="Array.html#M000145">recursively</a>.
|
705
|
-
</p>
|
706
|
-
</div>
|
707
|
-
<div class="sourcecode">
|
708
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000146_source')" id="l_M000146_source">+</a> ]</p>
|
709
|
-
<div id="M000146_source" class="dyn-source">
|
710
|
-
<pre>
|
711
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/recursively.rb, line 26</span>
|
712
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">recursively!</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
713
|
-
<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">recursively</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>))
|
714
|
-
<span class="ruby-keyword kw">end</span>
|
715
|
-
</pre>
|
716
|
-
</div>
|
717
|
-
</div>
|
718
|
-
</div>
|
719
|
-
<div class="method">
|
720
|
-
<div class="title">
|
721
|
-
<a name="M000149"></a><b>rotate</b>(n=1)
|
722
|
-
</div>
|
723
|
-
<div class="description">
|
724
|
-
<p>
|
725
|
-
Rotates an array‘s elements from back to front n times.
|
726
|
-
</p>
|
727
|
-
<pre>
|
728
|
-
[1,2,3].rotate #=> [3,1,2]
|
729
|
-
[3,1,2].rotate #=> [2,3,1]
|
730
|
-
[3,1,2].rotate #=> [1,2,3]
|
731
|
-
[1,2,3].rotate(3) #=> [1,2,3]
|
732
|
-
</pre>
|
733
|
-
<p>
|
734
|
-
A negative parameter reverses the order from front to back.
|
735
|
-
</p>
|
736
|
-
<pre>
|
737
|
-
[1,2,3].rotate(-1) #=> [2,3,1]
|
738
|
-
</pre>
|
739
|
-
<p>
|
740
|
-
CREDIT: Florian Gross, Thomas Sawyer
|
741
|
-
</p>
|
742
|
-
</div>
|
743
|
-
<div class="sourcecode">
|
744
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000149_source')" id="l_M000149_source">+</a> ]</p>
|
745
|
-
<div id="M000149_source" class="dyn-source">
|
746
|
-
<pre>
|
747
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/rotate.rb, line 16</span>
|
748
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rotate</span>(<span class="ruby-identifier">n</span>=<span class="ruby-value">1</span>)
|
749
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">rotate!</span>(<span class="ruby-identifier">n</span>)
|
750
|
-
<span class="ruby-keyword kw">end</span>
|
751
|
-
</pre>
|
752
|
-
</div>
|
753
|
-
</div>
|
754
|
-
</div>
|
755
|
-
<div class="method">
|
756
|
-
<div class="title">
|
757
|
-
<a name="M000150"></a><b>rotate!</b>(n=1)
|
758
|
-
</div>
|
759
|
-
<div class="description">
|
760
|
-
<p>
|
761
|
-
Same as <a href="Array.html#M000149">rotate</a>, but acts in place.
|
762
|
-
</p>
|
763
|
-
<pre>
|
764
|
-
a = [1,2,3]
|
765
|
-
a.rotate!
|
766
|
-
a #=> [3,1,2]
|
767
|
-
</pre>
|
768
|
-
<p>
|
769
|
-
CREDIT: Florian Gross, Thomas Sawyer
|
770
|
-
</p>
|
771
|
-
</div>
|
772
|
-
<div class="sourcecode">
|
773
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000150_source')" id="l_M000150_source">+</a> ]</p>
|
774
|
-
<div id="M000150_source" class="dyn-source">
|
775
|
-
<pre>
|
776
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/rotate.rb, line 28</span>
|
777
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rotate!</span>(<span class="ruby-identifier">n</span>=<span class="ruby-value">1</span>)
|
778
|
-
<span class="ruby-identifier">n</span> = <span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_int</span>
|
779
|
-
<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-value">0</span> <span class="ruby-keyword kw">or</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">empty?</span>)
|
780
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
781
|
-
<span class="ruby-identifier">n</span>.<span class="ruby-identifier">abs</span>.<span class="ruby-identifier">times</span>{ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unshift</span>( <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pop</span> ) }
|
782
|
-
<span class="ruby-keyword kw">else</span>
|
783
|
-
<span class="ruby-identifier">n</span>.<span class="ruby-identifier">abs</span>.<span class="ruby-identifier">times</span>{ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">push</span>( <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">shift</span> ) }
|
784
|
-
<span class="ruby-keyword kw">end</span>
|
785
|
-
<span class="ruby-keyword kw">self</span>
|
786
|
-
<span class="ruby-keyword kw">end</span>
|
787
|
-
</pre>
|
788
|
-
</div>
|
789
|
-
</div>
|
790
|
-
</div>
|
791
|
-
<div class="method">
|
792
|
-
<div class="title">
|
793
|
-
<a name="M000156"></a><b>select!</b>( {|| ...}
|
794
|
-
</div>
|
795
|
-
<div class="description">
|
796
|
-
<p>
|
797
|
-
As with select but modifies the <a href="Array.html">Array</a> in place.
|
798
|
-
</p>
|
799
|
-
<pre>
|
800
|
-
a = [1,2,3,4,5,6,7,8,9,10]
|
801
|
-
a.select!{ |e| e % 2 == 0 }
|
802
|
-
a #=> [2,4,6,8,10]
|
803
|
-
</pre>
|
804
|
-
<p>
|
805
|
-
CREDIT: Gavin Sinclair
|
806
|
-
</p>
|
807
|
-
</div>
|
808
|
-
<div class="sourcecode">
|
809
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000156_source')" id="l_M000156_source">+</a> ]</p>
|
810
|
-
<div id="M000156_source" class="dyn-source">
|
811
|
-
<pre>
|
812
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/select.rb, line 11</span>
|
813
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">select!</span> <span class="ruby-comment cmt"># :yield:</span>
|
814
|
-
<span class="ruby-identifier">reject!</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">not</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">e</span>) }
|
815
|
-
<span class="ruby-keyword kw">end</span>
|
816
|
-
</pre>
|
817
|
-
</div>
|
818
|
-
</div>
|
819
|
-
</div>
|
820
|
-
<div class="method">
|
821
|
-
<div class="title">
|
822
|
-
<a name="M000162"></a><b>splice</b>(*args)
|
823
|
-
</div>
|
824
|
-
<div class="description">
|
825
|
-
<p>
|
826
|
-
Splice acts a <a href="Array.html#M000159">combination</a> of slice! and
|
827
|
-
store. If two arguments are given it calls store. If a single argument is
|
828
|
-
give it calls slice!.
|
829
|
-
</p>
|
830
|
-
<pre>
|
831
|
-
a = [1,2,3]
|
832
|
-
a.splice(1) #=> 2
|
833
|
-
a #=> [1,3]
|
834
|
-
|
835
|
-
a = [1,2,3]
|
836
|
-
a.splice(1,4) #=> 4
|
837
|
-
a #=>[1,4,3]
|
838
|
-
</pre>
|
839
|
-
<p>
|
840
|
-
CREDIT: Trans
|
841
|
-
</p>
|
842
|
-
</div>
|
843
|
-
<div class="sourcecode">
|
844
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000162_source')" id="l_M000162_source">+</a> ]</p>
|
845
|
-
<div id="M000162_source" class="dyn-source">
|
846
|
-
<pre>
|
847
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/splice.rb, line 17</span>
|
848
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">splice</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
849
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
850
|
-
<span class="ruby-identifier">slice!</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
851
|
-
<span class="ruby-keyword kw">else</span>
|
852
|
-
<span class="ruby-identifier">store</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
853
|
-
<span class="ruby-keyword kw">end</span>
|
854
|
-
<span class="ruby-keyword kw">end</span>
|
855
|
-
</pre>
|
856
|
-
</div>
|
857
|
-
</div>
|
858
|
-
</div>
|
859
|
-
<div class="method">
|
860
|
-
<div class="title">
|
861
|
-
<a name="M000142"></a><b>to_b</b>()
|
862
|
-
</div>
|
863
|
-
<div class="description">
|
864
|
-
<p>
|
865
|
-
Boolean conversion for not empty?
|
866
|
-
</p>
|
867
|
-
</div>
|
868
|
-
<div class="sourcecode">
|
869
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000142_source')" id="l_M000142_source">+</a> ]</p>
|
870
|
-
<div id="M000142_source" class="dyn-source">
|
871
|
-
<pre>
|
872
|
-
<span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 60</span>
|
873
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_b</span>
|
874
|
-
<span class="ruby-operator">!</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">empty?</span>
|
875
|
-
<span class="ruby-keyword kw">end</span>
|
876
|
-
</pre>
|
877
|
-
</div>
|
878
|
-
</div>
|
879
|
-
</div>
|
880
|
-
<div class="method">
|
881
|
-
<div class="title">
|
882
|
-
<a name="M000136"></a><b>to_h</b>(mode=nil)
|
883
|
-
</div>
|
884
|
-
<div class="description">
|
885
|
-
<p>
|
886
|
-
Converts an array into a hash. Converting an array into a hash is not a
|
887
|
-
one-to-one conversion, for this reason <a
|
888
|
-
href="Array.html#M000136">to_h</a> examines at the array being converted
|
889
|
-
and then dispatches the conversion to the most sutiable specialized
|
890
|
-
function. There are three possiblities for this.
|
891
|
-
</p>
|
892
|
-
<p>
|
893
|
-
If the array is a collection of perfect pairs, like that which Hash#to_a
|
894
|
-
generates, then conversion is handled by <a
|
895
|
-
href="Array.html#M000139">to_h_flat</a>.
|
896
|
-
</p>
|
897
|
-
<pre>
|
898
|
-
a = [ [:a,1], [:b,2] ]
|
899
|
-
a.to_h #=> { :a=>1, :b=>2 }
|
900
|
-
</pre>
|
901
|
-
<p>
|
902
|
-
If the array contains <a href="Array.html#M000158">only</a> arrays, but are
|
903
|
-
not perfect pairs, then <a href="Array.html#M000141">to_h_multi</a> is
|
904
|
-
called.
|
905
|
-
</p>
|
906
|
-
<pre>
|
907
|
-
a = [ [:a,1,2], [:b,2], [:c], [:d] ]
|
908
|
-
a.to_h #=> { :a=>[1,2], :b=>[2], :c=>[], :d=>[] }
|
909
|
-
</pre>
|
910
|
-
<p>
|
911
|
-
If the array contians objects other then arrays then the <a
|
912
|
-
href="Array.html#M000138">to_h_splat</a> method is called.
|
913
|
-
</p>
|
914
|
-
<pre>
|
915
|
-
a = [ [:a,1,2], 2, :b, [:c,3], 9 ]
|
916
|
-
a.to_h #=> { [:a,1,2]=>2, :b=>[:c,3], 9=>nil }
|
917
|
-
</pre>
|
918
|
-
<p>
|
919
|
-
Finally, a particular dispatch can be forced by specifying the
|
920
|
-
<tt>mode</tt> of conversion, eg. +:multi+, +:splat+, +:flat+, +:assoc+,
|
921
|
-
etc.
|
922
|
-
</p>
|
923
|
-
<p>
|
924
|
-
Setting <tt>mode</tt> to <tt>true</tt> is the same as setting it +:multi+.
|
925
|
-
This has been left in for backward compatability.
|
926
|
-
</p>
|
927
|
-
<p>
|
928
|
-
NOTE: The use of a <tt>values</tt> parameter has been deprecated because
|
929
|
-
that functionality is as simple as:
|
930
|
-
</p>
|
931
|
-
<pre>
|
932
|
-
array1.zip(array2).to_h
|
933
|
-
</pre>
|
934
|
-
<p>
|
935
|
-
CREDIT: Robert Klemme CREDIT: Trans
|
936
|
-
</p>
|
937
|
-
</div>
|
938
|
-
<div class="sourcecode">
|
939
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000136_source')" id="l_M000136_source">+</a> ]</p>
|
940
|
-
<div id="M000136_source" class="dyn-source">
|
941
|
-
<pre>
|
942
|
-
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 53</span>
|
943
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h</span>(<span class="ruby-identifier">mode</span>=<span class="ruby-keyword kw">nil</span>)
|
944
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">mode</span>
|
945
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:splat</span>
|
946
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">to_h_splat</span>
|
947
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:flat</span>
|
948
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">to_h_flat</span>
|
949
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:multi</span>, <span class="ruby-keyword kw">true</span>
|
950
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">to_h_multi</span>
|
951
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:assoc</span>
|
952
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">to_h_assoc</span>
|
953
|
-
<span class="ruby-keyword kw">else</span>
|
954
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">to_h_auto</span>
|
955
|
-
<span class="ruby-keyword kw">end</span>
|
956
|
-
<span class="ruby-keyword kw">end</span>
|
957
|
-
</pre>
|
958
|
-
</div>
|
959
|
-
</div>
|
960
|
-
</div>
|
961
|
-
<div class="method">
|
962
|
-
<div class="title">
|
963
|
-
<a name="M000140"></a><b>to_h_assoc</b>()
|
964
|
-
</div>
|
965
|
-
<div class="description">
|
966
|
-
<p>
|
967
|
-
When a mixed or multi-element accociative array is used, the result is as
|
968
|
-
follows:
|
969
|
-
</p>
|
970
|
-
<pre>
|
971
|
-
a = [ [:a,1,2], [:b,2], [:c], :d ]
|
972
|
-
a.to_h #=> { :a=>[1,2], :b=>[2], :c=>[], :d=>[] }
|
973
|
-
</pre>
|
974
|
-
<p>
|
975
|
-
If the first entry of any subelements are the same, then the value will be
|
976
|
-
set to the last occuring value.
|
977
|
-
</p>
|
978
|
-
<pre>
|
979
|
-
a = [ :x, [:x], [:x,1,2], [:x,3], [:x,4] ]
|
980
|
-
a.to_h_assoc #=> { :x=>4 }
|
981
|
-
</pre>
|
982
|
-
</div>
|
983
|
-
<div class="sourcecode">
|
984
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000140_source')" id="l_M000140_source">+</a> ]</p>
|
985
|
-
<div id="M000140_source" class="dyn-source">
|
986
|
-
<pre>
|
987
|
-
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 157</span>
|
988
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_assoc</span>
|
989
|
-
<span class="ruby-identifier">h</span> = {}
|
990
|
-
<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
991
|
-
<span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>
|
992
|
-
<span class="ruby-keyword kw">end</span>
|
993
|
-
<span class="ruby-identifier">h</span>
|
994
|
-
<span class="ruby-keyword kw">end</span>
|
995
|
-
</pre>
|
996
|
-
</div>
|
997
|
-
</div>
|
998
|
-
</div>
|
999
|
-
<div class="method">
|
1000
|
-
<div class="title">
|
1001
|
-
<a name="M000137"></a><b>to_h_auto</b>()
|
1002
|
-
</div>
|
1003
|
-
<div class="description">
|
1004
|
-
<p>
|
1005
|
-
Converts an array into a hash. Converting an array into a hash is not a
|
1006
|
-
one-to-one conversion, for this reason <a
|
1007
|
-
href="Array.html#M000136">to_h</a> examines at the array being converted
|
1008
|
-
and then dispatches the conversion to the most sutiable specialized
|
1009
|
-
function. There are three possiblities for this.
|
1010
|
-
</p>
|
1011
|
-
<p>
|
1012
|
-
If the array is a collection of perfect pairs, like that which Hash#to_a
|
1013
|
-
generates, then conversion is handled by <a
|
1014
|
-
href="Array.html#M000139">to_h_flat</a>.
|
1015
|
-
</p>
|
1016
|
-
<pre>
|
1017
|
-
a = [ [:a,1], [:b,2] ]
|
1018
|
-
a.to_h #=> { :a=>1, :b=>2 }
|
1019
|
-
</pre>
|
1020
|
-
<p>
|
1021
|
-
If the array contains <a href="Array.html#M000158">only</a> arrays, but are
|
1022
|
-
not perfect pairs, then <a href="Array.html#M000141">to_h_multi</a> is
|
1023
|
-
called.
|
1024
|
-
</p>
|
1025
|
-
<pre>
|
1026
|
-
a = [ [:a,1,2], [:b,2], [:c], [:d] ]
|
1027
|
-
a.to_h #=> { :a=>[1,2], :b=>[2], :c=>[], :d=>[] }
|
1028
|
-
</pre>
|
1029
|
-
<p>
|
1030
|
-
If the array contians objects other then arrays then the <a
|
1031
|
-
href="Array.html#M000138">to_h_splat</a> method is called.
|
1032
|
-
</p>
|
1033
|
-
<pre>
|
1034
|
-
a = [ [:a,1,2], 2, :b, [:c,3], 9 ]
|
1035
|
-
a.to_h #=> { [:a,1,2]=>2, :b=>[:c,3], 9=>nil }
|
1036
|
-
</pre>
|
1037
|
-
</div>
|
1038
|
-
<div class="sourcecode">
|
1039
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000137_source')" id="l_M000137_source">+</a> ]</p>
|
1040
|
-
<div id="M000137_source" class="dyn-source">
|
1041
|
-
<pre>
|
1042
|
-
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 93</span>
|
1043
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_auto</span>
|
1044
|
-
<span class="ruby-identifier">pairs</span> = <span class="ruby-keyword kw">true</span>
|
1045
|
-
<span class="ruby-identifier">mixed</span> = <span class="ruby-keyword kw">false</span>
|
1046
|
-
|
1047
|
-
<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
|
1048
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">e</span>
|
1049
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">Array</span>
|
1050
|
-
<span class="ruby-identifier">pairs</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">2</span>
|
1051
|
-
<span class="ruby-keyword kw">else</span>
|
1052
|
-
<span class="ruby-identifier">mixed</span> = <span class="ruby-keyword kw">true</span>
|
1053
|
-
<span class="ruby-keyword kw">end</span>
|
1054
|
-
<span class="ruby-keyword kw">end</span>
|
1055
|
-
|
1056
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mixed</span>
|
1057
|
-
<span class="ruby-identifier">to_h_splat</span>
|
1058
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">pairs</span>
|
1059
|
-
<span class="ruby-identifier">to_h_flat</span>
|
1060
|
-
<span class="ruby-keyword kw">else</span>
|
1061
|
-
<span class="ruby-identifier">to_h_multi</span>
|
1062
|
-
<span class="ruby-keyword kw">end</span>
|
1063
|
-
<span class="ruby-keyword kw">end</span>
|
1064
|
-
</pre>
|
1065
|
-
</div>
|
1066
|
-
</div>
|
1067
|
-
</div>
|
1068
|
-
<div class="method">
|
1069
|
-
<div class="title">
|
1070
|
-
<a name="M000139"></a><b>to_h_flat</b>()
|
1071
|
-
</div>
|
1072
|
-
<div class="description">
|
1073
|
-
<p>
|
1074
|
-
This is equivalent to <a href="http://*array.flatten">Hash</a>, but it will
|
1075
|
-
<a href="Array.html#M000163">pad</a> the array with a <tt>nil</tt> object
|
1076
|
-
if there are not an even number of elements.
|
1077
|
-
</p>
|
1078
|
-
<pre>
|
1079
|
-
a = [:a,1,[:b,2,:c]]
|
1080
|
-
a.to_h_flat #=> { :a=>1, :b=>2, :c=>nil }
|
1081
|
-
</pre>
|
1082
|
-
</div>
|
1083
|
-
<div class="sourcecode">
|
1084
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000139_source')" id="l_M000139_source">+</a> ]</p>
|
1085
|
-
<div id="M000139_source" class="dyn-source">
|
1086
|
-
<pre>
|
1087
|
-
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 135</span>
|
1088
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_flat</span>
|
1089
|
-
<span class="ruby-identifier">a</span> = <span class="ruby-identifier">flatten</span>
|
1090
|
-
<span class="ruby-identifier">a</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</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>
|
1091
|
-
<span class="ruby-constant">Hash</span>[<span class="ruby-operator">*</span><span class="ruby-identifier">a</span>]
|
1092
|
-
<span class="ruby-keyword kw">end</span>
|
1093
|
-
</pre>
|
1094
|
-
</div>
|
1095
|
-
</div>
|
1096
|
-
</div>
|
1097
|
-
<div class="method">
|
1098
|
-
<div class="title">
|
1099
|
-
<a name="M000141"></a><b>to_h_multi</b>()
|
1100
|
-
</div>
|
1101
|
-
<div class="description">
|
1102
|
-
<p>
|
1103
|
-
When a mixed or multi-element accociative array is used, the result is as
|
1104
|
-
follows:
|
1105
|
-
</p>
|
1106
|
-
<pre>
|
1107
|
-
a = [ [:a,1,2], [:b,2], [:c], :d ]
|
1108
|
-
a.to_h #=> { :a=>[1,2], :b=>[2], :c=>[], :d=>[] }
|
1109
|
-
</pre>
|
1110
|
-
<p>
|
1111
|
-
If the first entry of the subelements is the same, then the values will be
|
1112
|
-
merged using concat.
|
1113
|
-
</p>
|
1114
|
-
<pre>
|
1115
|
-
a = [ [:a,1,2], [:a,3], [:a,4], [:a], :a ]
|
1116
|
-
a.to_h_multi #=> { :a=>[1,2,3,4] }
|
1117
|
-
</pre>
|
1118
|
-
</div>
|
1119
|
-
<div class="sourcecode">
|
1120
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000141_source')" id="l_M000141_source">+</a> ]</p>
|
1121
|
-
<div id="M000141_source" class="dyn-source">
|
1122
|
-
<pre>
|
1123
|
-
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 177</span>
|
1124
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_multi</span>
|
1125
|
-
<span class="ruby-identifier">h</span> = {}
|
1126
|
-
<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
1127
|
-
<span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] <span class="ruby-operator">||=</span> []
|
1128
|
-
<span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>].<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">v</span>)
|
1129
|
-
<span class="ruby-keyword kw">end</span>
|
1130
|
-
<span class="ruby-identifier">h</span>
|
1131
|
-
<span class="ruby-keyword kw">end</span>
|
1132
|
-
</pre>
|
1133
|
-
</div>
|
1134
|
-
</div>
|
1135
|
-
</div>
|
1136
|
-
<div class="method">
|
1137
|
-
<div class="title">
|
1138
|
-
<a name="M000138"></a><b>to_h_splat</b>()
|
1139
|
-
</div>
|
1140
|
-
<div class="description">
|
1141
|
-
<p>
|
1142
|
-
This is equivalent to <a href="Hash.html">Hash</a>[*array], but it will <a
|
1143
|
-
href="Array.html#M000163">pad</a> the array with a <tt>nil</tt> object if
|
1144
|
-
there are not an even number of elements.
|
1145
|
-
</p>
|
1146
|
-
<pre>
|
1147
|
-
a = [:a,1,:b,2,:c]
|
1148
|
-
a.to_h_splat #=> { :a=>1, :b=>2, :c=>nil }
|
1149
|
-
</pre>
|
1150
|
-
</div>
|
1151
|
-
<div class="sourcecode">
|
1152
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000138_source')" id="l_M000138_source">+</a> ]</p>
|
1153
|
-
<div id="M000138_source" class="dyn-source">
|
1154
|
-
<pre>
|
1155
|
-
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 122</span>
|
1156
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_splat</span>
|
1157
|
-
<span class="ruby-identifier">a</span> = <span class="ruby-identifier">dup</span>
|
1158
|
-
<span class="ruby-identifier">a</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</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>
|
1159
|
-
<span class="ruby-constant">Hash</span>[<span class="ruby-operator">*</span><span class="ruby-identifier">a</span>]
|
1160
|
-
<span class="ruby-keyword kw">end</span>
|
1161
|
-
</pre>
|
1162
|
-
</div>
|
1163
|
-
</div>
|
1164
|
-
</div>
|
1165
|
-
<div class="method">
|
1166
|
-
<div class="title">
|
1167
|
-
<a name="M000153"></a><b>traverse</b>() {|item| ...}
|
1168
|
-
</div>
|
1169
|
-
<div class="sourcecode">
|
1170
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000153_source')" id="l_M000153_source">+</a> ]</p>
|
1171
|
-
<div id="M000153_source" class="dyn-source">
|
1172
|
-
<pre>
|
1173
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/traverse.rb, line 5</span>
|
1174
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">traverse</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
1175
|
-
<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
|
1176
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
|
1177
|
-
<span class="ruby-identifier">item</span>.<span class="ruby-identifier">traverse</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
1178
|
-
<span class="ruby-keyword kw">else</span>
|
1179
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">item</span>
|
1180
|
-
<span class="ruby-keyword kw">end</span>
|
1181
|
-
<span class="ruby-keyword kw">end</span>
|
1182
|
-
<span class="ruby-keyword kw">end</span>
|
1183
|
-
</pre>
|
1184
|
-
</div>
|
1185
|
-
</div>
|
1186
|
-
</div>
|
1187
|
-
<div class="method">
|
1188
|
-
<div class="title">
|
1189
|
-
<a name="M000154"></a><b>traverse!</b>(&block)
|
1190
|
-
</div>
|
1191
|
-
<div class="sourcecode">
|
1192
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000154_source')" id="l_M000154_source">+</a> ]</p>
|
1193
|
-
<div id="M000154_source" class="dyn-source">
|
1194
|
-
<pre>
|
1195
|
-
<span class="ruby-comment cmt"># File lib/core/facets/array/traverse.rb, line 17</span>
|
1196
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">traverse!</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
1197
|
-
<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">traverse</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>))
|
1198
|
-
<span class="ruby-keyword kw">end</span>
|
1199
|
-
</pre>
|
1200
|
-
</div>
|
1201
|
-
</div>
|
1202
|
-
</div>
|
1203
|
-
</div>
|
1204
|
-
|
1205
|
-
</div>
|
1206
|
-
|
1207
|
-
</body>
|
1208
|
-
</html>
|