facets 2.4.5 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +6 -2
- data/CHANGES +46 -52
- data/MANIFEST +680 -642
- data/README +3 -10
- data/RELEASE +82 -36
- data/VERSION +1 -1
- data/doc/archive/{changelog-0.rdoc → CHANGELOG-0.10.30} +0 -0
- data/doc/archive/{changelog-1.rdoc → CHANGELOG-1.8.54} +0 -0
- data/doc/archive/CHANGELOG-2.4.5 +1654 -0
- data/doc/{news → archive}/RELEASE-2.0.5 +0 -0
- data/doc/{news → archive}/RELEASE-2.1.0 +0 -0
- data/doc/{news → archive}/RELEASE-2.1.1 +0 -0
- data/doc/{news → archive}/RELEASE-2.1.2 +0 -0
- data/doc/{news → archive}/RELEASE-2.1.3 +0 -0
- data/doc/{news → archive}/RELEASE-2.2.0 +0 -0
- data/doc/{news → archive}/RELEASE-2.2.1 +0 -0
- data/doc/{news → archive}/RELEASE-2.3.0 +0 -0
- data/doc/{news → archive}/RELEASE-2.4.0 +0 -0
- data/doc/{news → archive}/RELEASE-2.4.1 +0 -0
- data/doc/{news → archive}/RELEASE-2.4.2 +0 -0
- data/doc/{news → archive}/RELEASE-2.4.3 +0 -0
- data/doc/{news → archive}/RELEASE-2.4.4 +0 -0
- data/doc/archive/RELEASE-2.4.5 +37 -0
- data/doc/{book/history.rdoc → guide/notes.rd} +62 -4
- data/doc/log/basic_stats/index.html +39 -0
- data/doc/log/bstats/stats.html +39 -0
- data/doc/log/changelog.html +141 -0
- data/doc/log/changelog.txt +1609 -0
- data/doc/log/stats.html +25 -0
- data/doc/log/testlog.txt +278 -0
- data/doc/rdoc/core/classes/Array.html +158 -147
- data/doc/rdoc/core/classes/Binding.html +54 -54
- data/doc/rdoc/core/classes/Class.html +59 -57
- data/doc/rdoc/core/classes/Comparable.html +67 -76
- data/doc/rdoc/core/classes/Dir.html +47 -47
- data/doc/rdoc/core/classes/Enumerable.html +232 -192
- data/doc/rdoc/core/classes/Exception.html +15 -16
- data/doc/rdoc/core/classes/File.html +128 -85
- data/doc/rdoc/core/classes/FileTest.html +7 -7
- data/doc/rdoc/core/classes/Float.html +16 -14
- data/doc/rdoc/core/classes/Functor.html +12 -12
- data/doc/rdoc/core/classes/Hash.html +490 -319
- data/doc/rdoc/core/classes/Indexable.html +110 -110
- data/doc/rdoc/core/classes/InstanceVariables.html +44 -44
- data/doc/rdoc/core/classes/Integer.html +122 -116
- data/doc/rdoc/core/classes/Kernel.html +415 -401
- data/doc/rdoc/core/classes/Lazy/Promise.html +1 -1
- data/doc/rdoc/core/classes/MatchData.html +24 -21
- data/doc/rdoc/core/classes/Module.html +230 -229
- data/doc/rdoc/core/classes/NilClass.html +28 -26
- data/doc/rdoc/core/classes/Numeric.html +30 -30
- data/doc/rdoc/core/classes/Object.html +8 -8
- data/doc/rdoc/core/classes/{Friend.html → ObjectSpace.html} +25 -48
- data/doc/rdoc/core/classes/Proc.html +29 -27
- data/doc/rdoc/core/classes/Range.html +17 -15
- data/doc/rdoc/core/classes/Regexp.html +17 -17
- data/doc/rdoc/core/classes/Stackable.html +31 -31
- data/doc/rdoc/core/classes/String.html +445 -401
- data/doc/rdoc/{more/classes/CLI/NoOptionError.html → core/classes/Struct.html} +24 -21
- data/doc/rdoc/core/classes/Symbol.html +73 -65
- data/doc/rdoc/core/classes/Time.html +87 -86
- data/doc/rdoc/core/classes/TrueClass.html +8 -8
- data/doc/rdoc/core/classes/UnboundMethod.html +17 -16
- data/doc/rdoc/core/created.rid +1 -1
- data/doc/rdoc/core/files/README.html +10 -16
- data/doc/rdoc/core/files/lib/core/facets/array/combination_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/conjoin_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/delete_rb.html +10 -1
- data/doc/rdoc/core/files/lib/core/facets/array/delete_unless_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/array/delete_values_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/array/index_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/indexable_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/merge_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/only_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/pad_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/permutation_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/product_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/rotate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/select_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/splice_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/stackable_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/binding/caller_rb.html +2 -2
- data/doc/rdoc/core/files/lib/core/facets/binding/callstack_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/binding/defined_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/bitmask_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/class/cattr_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/class/descendents_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/class/prepend_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/class/to_proc_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/comparable/at_least_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/comparable/at_most_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/comparable/bound_rb.html +5 -1
- data/doc/rdoc/core/files/lib/core/facets/comparable/cap_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/comparable/clip_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/comparable/cmp_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/comparable/comparable_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/dir/ascend_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/dir/multiglob_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/dir/recurse_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/accumulate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/cluster_by_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/collect_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/commonality_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/count_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/divide_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/duplicates_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/each_by_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/entropy_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/frequency_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/graph_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/enumerable/group_by_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/inject_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/map_send_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/mash_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/mode_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/modulate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/none_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/occur_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/one_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/probability_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/sum_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/take_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/enumerable/uniq_by_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/exception/detail_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/exception/suppress_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/append_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/create_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/null_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/read_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/rewrite_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/rootname_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/split_all_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/file/split_root_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/write_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/writelines_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/filetest/root_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/alias_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/autonew_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/collate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/delete_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/insert_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/inverse_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/join_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/keys_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_add_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_and_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_mul_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_or_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_push_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_sub_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/rekey_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/replace_each_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/select_rb.html +1 -1
- data/doc/rdoc/{more/files/lib/more → core/files/lib/core}/facets/hash/stringify_keys_rb.html +1 -1
- data/doc/rdoc/{more/files/lib/more → core/files/lib/core}/facets/hash/symbolize_keys_rb.html +2 -2
- data/doc/rdoc/core/files/lib/core/facets/hash/to_options_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/to_struct_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/traverse_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/update_each_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/update_keys_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/update_rb.html +8 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/update_values_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/weave_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/zipnew_rb.html +1 -5
- data/doc/rdoc/core/files/lib/core/facets/integer/factorial_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/integer/multiple_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/integer/odd_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/__here___rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/kernel/as_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/ask_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/attr_singleton_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/callstack_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/kernel/complete_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/constant_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/d_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/demo_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/ergo_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/instance_class_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/instance_variables_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/not_nil_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/object_send_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/p_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/populate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/qua_class_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/resc_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/respond_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/returning_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/silence_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/try_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/matchdata/match_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/matchdata/matchset_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/metaid_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/abstract_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/alias_accessor_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/alias_method_chain_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/alias_module_function_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/ancestor_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/basename_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/conflict_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/include_function_module_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/instance_methods_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/is_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/methodize_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/modspace_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/module_load_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/nesting_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/op_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/prepend_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/redefine_method_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/rename_method_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/revise_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/spacename_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/wrap_method_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/nilclass/to_f_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/numeric/approx_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/numeric/distance_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/numeric/round_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/objectspace/classes_rb.html +92 -0
- data/doc/rdoc/{more/files/lib/more/facets/dictionarymatcher_rb.html → core/files/lib/core/facets/objectspace_rb.html} +4 -4
- data/doc/rdoc/core/files/lib/core/facets/proc/bind_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/proc/compose_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/proc/to_method_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/proc/update_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/range/combine_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/range/overlap_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/range/within_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/regexp/arity_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/align_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/bracket_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/camelcase_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/capitalized_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/chars_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/chomp_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/cleave_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/compress_lines_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/contains_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/divide_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/expand_tab_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/fold_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/indent_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/interpolate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/line_wrap_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/lines_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/margin_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/methodize_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/mscan_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/natcmp_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/nchar_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/op_sub_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/outdent_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/string/range_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/rewrite_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/shatter_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/snakecase_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/splice_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/start_with_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/tab_rb.html +8 -1
- data/doc/rdoc/core/files/lib/core/facets/string/tabto_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/string/titlecase_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/to_re_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/word_wrap_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/struct/attributes_rb.html +92 -0
- data/doc/rdoc/{more/files/lib/more/facets/bytes_rb.html → core/files/lib/core/facets/struct_rb.html} +4 -4
- data/doc/rdoc/core/files/lib/core/facets/symbol/chomp_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/symbol/generate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/symbol/not_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/symbol/succ_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/symbol/to_proc_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/time/advance_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/time/change_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/time/elapse_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/time/hence_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/time/stamp_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/to_hash_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/unboundmethod/arguments_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/unboundmethod/name_rb.html +1 -1
- data/doc/rdoc/core/fr_class_index.html +2 -1
- data/doc/rdoc/core/fr_file_index.html +30 -1
- data/doc/rdoc/core/fr_method_index.html +430 -423
- data/doc/rdoc/lore/classes/Date.html +6 -5
- data/doc/rdoc/{more/classes/CLI/Command/UniversalOptions.html → lore/classes/Enumerable.html} +7 -9
- data/doc/rdoc/lore/classes/Enumerable/Enumerator.html +147 -0
- data/doc/rdoc/lore/classes/OpenStruct.html +13 -15
- data/doc/rdoc/lore/created.rid +1 -1
- data/doc/rdoc/lore/files/README.html +10 -16
- data/doc/rdoc/lore/files/lib/lore/facets/date_rb.html +1 -1
- data/doc/rdoc/lore/files/lib/lore/facets/enumerator_rb.html +111 -0
- data/doc/rdoc/lore/files/lib/lore/facets/ostruct_rb.html +1 -1
- data/doc/rdoc/lore/fr_class_index.html +2 -0
- data/doc/rdoc/lore/fr_file_index.html +1 -0
- data/doc/rdoc/lore/fr_method_index.html +13 -12
- data/doc/rdoc/more/classes/ANSICode.html +66 -66
- data/doc/rdoc/more/classes/Advisable.html +37 -37
- data/doc/rdoc/more/classes/Advisable/Method.html +20 -20
- data/doc/rdoc/more/classes/Archive/Tar/Minitar.html +27 -27
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Input.html +28 -28
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Output.html +19 -19
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Reader.html +31 -31
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Writer.html +33 -33
- data/doc/rdoc/more/classes/Argvector.html +76 -76
- data/doc/rdoc/more/classes/Association.html +28 -28
- data/doc/rdoc/more/classes/Association/Kernel.html +8 -8
- data/doc/rdoc/more/classes/Autoarray.html +12 -12
- data/doc/rdoc/more/classes/BBCode.html +34 -34
- data/doc/rdoc/more/classes/BaseX.html +16 -16
- data/doc/rdoc/more/classes/BiCrypt.html +67 -67
- data/doc/rdoc/more/classes/BinReadable.html +85 -85
- data/doc/rdoc/more/classes/BinReadable/ByteOrder.html +25 -25
- data/doc/rdoc/more/classes/Binding.html +8 -8
- data/doc/rdoc/more/classes/BlankSlate.html +5 -5
- data/doc/rdoc/more/classes/Buildable.html +4 -4
- data/doc/rdoc/more/classes/BuildingBlock.html +32 -32
- data/doc/rdoc/more/classes/Capsule.html +41 -41
- data/doc/rdoc/more/classes/Cloneable.html +4 -4
- data/doc/rdoc/more/classes/ConsoleUtils.html +22 -22
- data/doc/rdoc/more/classes/Coroutine.html +28 -28
- data/doc/rdoc/more/classes/Crypt.html +16 -16
- data/doc/rdoc/more/classes/CssFilter.html +45 -45
- data/doc/rdoc/more/classes/CssTree.html +8 -8
- data/doc/rdoc/more/classes/Dictionary.html +228 -228
- data/doc/rdoc/more/classes/Downloader.html +56 -56
- data/doc/rdoc/more/classes/Duration.html +369 -445
- data/doc/rdoc/more/classes/Duration/Numeric.html +389 -0
- data/doc/rdoc/more/classes/{CLI/NoCommandError.html → Duration/Time.html} +30 -17
- data/doc/rdoc/more/classes/Enumerable.html +114 -51
- data/doc/rdoc/more/classes/Enumerable/Elementor.html +16 -16
- data/doc/rdoc/more/classes/Enumerable/Enumerator.html +4 -4
- data/doc/rdoc/more/classes/Enumerable/Filterable.html +246 -0
- data/doc/rdoc/more/classes/EnumerablePass.html +17 -17
- data/doc/rdoc/more/classes/{RecursiveDependency.html → Enumerator.html} +7 -4
- data/doc/rdoc/more/classes/{CLI.html → Enumerator/Filter.html} +22 -26
- data/doc/rdoc/more/classes/Equatable.html +16 -16
- data/doc/rdoc/more/classes/Expirable.html +17 -17
- data/doc/rdoc/more/classes/FileList.html +125 -125
- data/doc/rdoc/more/classes/Fileable.html +14 -14
- data/doc/rdoc/more/classes/Fileable/DSL.html +41 -41
- data/doc/rdoc/more/classes/Hash.html +16 -162
- data/doc/rdoc/more/classes/Hash2Xml.html +4 -4
- data/doc/rdoc/more/classes/HtmlFilter.html +9 -9
- data/doc/rdoc/more/classes/IORedirect.html +19 -19
- data/doc/rdoc/more/classes/InfinityClass.html +36 -36
- data/doc/rdoc/more/classes/InfinityClass/Numeric.html +23 -23
- data/doc/rdoc/more/classes/Ini.html +37 -37
- data/doc/rdoc/more/classes/Instantiable.html +9 -9
- data/doc/rdoc/more/classes/Instantize.html +8 -8
- data/doc/rdoc/more/classes/Interval.html +187 -187
- data/doc/rdoc/more/classes/It.html +12 -12
- data/doc/rdoc/more/classes/LRUCache.html +38 -38
- data/doc/rdoc/more/classes/LinkedList.html +68 -68
- data/doc/rdoc/more/classes/LinkedList/Node.html +4 -4
- data/doc/rdoc/more/classes/{DictionaryMatcher.html → Matcher.html} +66 -68
- data/doc/rdoc/more/classes/{DictionaryMatcher → Matcher}/MatchData.html +8 -8
- data/doc/rdoc/more/classes/{CacheDecorator.html → Memoizer.html} +64 -46
- data/doc/rdoc/more/classes/Module.html +182 -361
- data/doc/rdoc/more/classes/Multiton.html +12 -12
- data/doc/rdoc/more/classes/Multiton/MetaMethods.html +28 -28
- data/doc/rdoc/more/classes/Net/SMTP.html +8 -8
- data/doc/rdoc/more/classes/NullClass.html +24 -24
- data/doc/rdoc/more/classes/Numeric/Multipliers.html +456 -0
- data/doc/rdoc/more/classes/ObjectReflection.html +12 -12
- data/doc/rdoc/more/classes/OpEsc.html +8 -7
- data/doc/rdoc/more/classes/OpenCascade.html +4 -4
- data/doc/rdoc/more/classes/OpenCollection.html +8 -8
- data/doc/rdoc/more/classes/OpenHash.html +9 -9
- data/doc/rdoc/more/classes/{EventHook.html → OpenModule.html} +24 -63
- data/doc/rdoc/more/classes/OpenObject.html +95 -95
- data/doc/rdoc/more/classes/OpenStructable.html +326 -0
- data/doc/rdoc/more/classes/PQueue.html +84 -84
- data/doc/rdoc/more/classes/Paramix.html +11 -11
- data/doc/rdoc/more/classes/Paramix/Delegator.html +16 -16
- data/doc/rdoc/more/classes/PathList.html +8 -8
- data/doc/rdoc/more/classes/PathList/Finder.html +8 -8
- data/doc/rdoc/more/classes/Platform.html +46 -46
- data/doc/rdoc/more/classes/Pool.html +18 -18
- data/doc/rdoc/more/classes/Proc.html +9 -9
- data/doc/rdoc/more/classes/ProgressBar.html +52 -52
- data/doc/rdoc/more/classes/Prototype.html +28 -28
- data/doc/rdoc/more/classes/RWDelegator.html +16 -16
- data/doc/rdoc/more/classes/Random.html +5 -5
- data/doc/rdoc/more/classes/Random/Array.html +37 -37
- data/doc/rdoc/more/classes/Random/Hash.html +52 -52
- data/doc/rdoc/more/classes/Random/Object.html +4 -4
- data/doc/rdoc/more/classes/Random/String.html +34 -34
- data/doc/rdoc/more/classes/Random/String/Self.html +9 -9
- data/doc/rdoc/more/classes/Recorder.html +16 -16
- data/doc/rdoc/more/classes/Reference.html +19 -19
- data/doc/rdoc/more/classes/Registerable.html +13 -13
- data/doc/rdoc/more/classes/Semaphore.html +36 -36
- data/doc/rdoc/more/classes/Settings.html +28 -28
- data/doc/rdoc/more/classes/Settings/Setting.html +13 -13
- data/doc/rdoc/more/classes/Settings/SettingCollection.html +4 -4
- data/doc/rdoc/more/classes/SimpleStringIO.html +8 -8
- data/doc/rdoc/more/classes/Snapshot.html +16 -16
- data/doc/rdoc/more/classes/Snapshot/ValueHolder.html +12 -12
- data/doc/rdoc/more/classes/SparseArray.html +1397 -0
- data/doc/rdoc/more/classes/Stash.html +232 -0
- data/doc/rdoc/more/classes/String/Mask.html +72 -72
- data/doc/rdoc/more/classes/String/Words.html +49 -49
- data/doc/rdoc/more/classes/Struct.html +8 -8
- data/doc/rdoc/more/classes/SyncArray.html +4 -4
- data/doc/rdoc/more/classes/SyncHash.html +4 -4
- data/doc/rdoc/more/classes/SyncHash/Delegator.html +28 -28
- data/doc/rdoc/more/classes/SyncHash/Inheritor.html +28 -28
- data/doc/rdoc/more/classes/System.html +253 -253
- data/doc/rdoc/more/classes/Timer.html +48 -48
- data/doc/rdoc/more/classes/Timer/Dummy.html +9 -9
- data/doc/rdoc/more/classes/TracePoint.html +58 -58
- data/doc/rdoc/more/classes/Tuple.html +170 -170
- data/doc/rdoc/more/classes/TypeCast/Class.html +4 -4
- data/doc/rdoc/more/classes/TypeCast/Object.html +4 -4
- data/doc/rdoc/more/classes/Uninheritable.html +6 -6
- data/doc/rdoc/more/classes/VersionNumber.html +57 -57
- data/doc/rdoc/more/classes/XOXO.html +9 -9
- data/doc/rdoc/more/classes/ZipUtils.html +251 -118
- data/doc/rdoc/more/classes/ZipUtils/DryRun.html +203 -35
- data/doc/rdoc/more/classes/ZipUtils/NoWrite.html +203 -35
- data/doc/rdoc/more/classes/ZipUtils/Verbose.html +173 -35
- data/doc/rdoc/more/created.rid +1 -1
- data/doc/rdoc/more/files/README.html +10 -16
- data/doc/rdoc/more/files/lib/more/facets/attr_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/buildable_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/consoleutils_rb.html +1 -18
- data/doc/rdoc/more/files/lib/more/facets/dependency_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/duration_rb.html +1 -41
- data/doc/rdoc/more/files/lib/more/facets/elementor_rb.html +2 -1
- data/doc/rdoc/more/files/lib/more/facets/enumerablepass_rb.html +2 -1
- data/doc/rdoc/more/files/lib/more/facets/{fileshell_rb.html → filter_rb.html} +6 -5
- data/doc/rdoc/more/files/lib/more/facets/inheritor_rb.html +3 -28
- data/doc/rdoc/more/files/lib/more/facets/iteration_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/kernel/meta_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/matcher_rb.html +97 -0
- data/doc/rdoc/more/files/lib/more/facets/memoize_rb.html +7 -4
- data/doc/rdoc/more/files/lib/more/facets/{cachedecorator_rb.html → memoizer_rb.html} +23 -49
- data/doc/rdoc/more/files/lib/more/facets/multipliers_rb.html +2 -18
- data/doc/rdoc/more/files/lib/more/facets/nilstatus_rb.html +1 -1
- data/doc/rdoc/{core/files/lib/core/facets/callstack_rb.html → more/files/lib/more/facets/openmodule_rb.html} +4 -4
- data/doc/rdoc/more/files/lib/more/facets/opesc_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/ostructable_rb.html +92 -0
- data/doc/rdoc/more/files/lib/more/facets/pathlist_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/snapshot_rb.html +2 -2
- data/doc/rdoc/more/files/lib/more/facets/sparse_array_rb.html +92 -0
- data/doc/rdoc/more/files/lib/more/facets/stash_rb.html +166 -0
- data/doc/rdoc/more/files/lib/more/facets/string/words_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/succ_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/thread_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/ziputils_rb.html +6 -34
- data/doc/rdoc/more/fr_class_index.html +13 -17
- data/doc/rdoc/more/fr_file_index.html +7 -15
- data/doc/rdoc/more/fr_method_index.html +1079 -1003
- data/doc/rdoc/more/index.html +1 -1
- data/lib/core/facets/array/conjoin.rb +1 -1
- data/lib/core/facets/array/delete.rb +3 -60
- data/lib/core/facets/array/delete_unless.rb +15 -0
- data/lib/core/facets/array/delete_values.rb +50 -0
- data/lib/core/facets/array/index.rb +0 -26
- data/lib/core/facets/array/indexable.rb +2 -2
- data/lib/core/facets/array/merge.rb +1 -1
- data/lib/core/facets/array/only.rb +1 -2
- data/lib/core/facets/array/pad.rb +2 -2
- data/lib/core/facets/array/permutation.rb +1 -1
- data/lib/core/facets/array/product.rb +2 -2
- data/lib/core/facets/array/rotate.rb +2 -4
- data/lib/core/facets/array/select.rb +1 -1
- data/lib/core/facets/array/splice.rb +1 -1
- data/lib/core/facets/array/stackable.rb +2 -2
- data/lib/core/facets/binding/caller.rb +2 -7
- data/lib/core/facets/binding/callstack.rb +1 -0
- data/lib/core/facets/binding/defined.rb +0 -1
- data/lib/core/facets/bitmask.rb +6 -9
- data/lib/core/facets/class/cattr.rb +6 -9
- data/lib/core/facets/class/descendents.rb +0 -2
- data/lib/core/facets/class/prepend.rb +3 -4
- data/lib/core/facets/class/to_proc.rb +0 -20
- data/lib/core/facets/comparable/at_least.rb +1 -0
- data/lib/core/facets/comparable/at_most.rb +1 -0
- data/lib/core/facets/comparable/bound.rb +1 -65
- data/lib/core/facets/comparable/cap.rb +34 -0
- data/lib/core/facets/comparable/clip.rb +38 -0
- data/lib/core/facets/comparable/cmp.rb +3 -3
- data/lib/core/facets/comparable/comparable.rb +1 -1
- data/lib/core/facets/dir/ascend.rb +2 -5
- data/lib/core/facets/dir/multiglob.rb +0 -2
- data/lib/core/facets/dir/recurse.rb +1 -2
- data/lib/core/facets/enumerable/accumulate.rb +2 -0
- data/lib/core/facets/enumerable/cluster_by.rb +1 -1
- data/lib/core/facets/enumerable/collect.rb +2 -2
- data/lib/core/facets/enumerable/commonality.rb +1 -1
- data/lib/core/facets/enumerable/count.rb +1 -1
- data/lib/core/facets/enumerable/divide.rb +1 -1
- data/lib/core/facets/enumerable/duplicates.rb +2 -2
- data/lib/core/facets/enumerable/each_by.rb +1 -1
- data/lib/core/facets/enumerable/entropy.rb +2 -2
- data/lib/core/facets/enumerable/frequency.rb +1 -1
- data/lib/core/facets/enumerable/graph.rb +1 -0
- data/lib/core/facets/enumerable/group_by.rb +1 -1
- data/lib/core/facets/enumerable/inject.rb +2 -3
- data/lib/core/facets/enumerable/map_send.rb +15 -3
- data/lib/core/facets/enumerable/mash.rb +4 -5
- data/lib/core/facets/enumerable/mode.rb +1 -1
- data/lib/core/facets/enumerable/modulate.rb +2 -2
- data/lib/core/facets/enumerable/none.rb +1 -1
- data/lib/core/facets/enumerable/occur.rb +0 -2
- data/lib/core/facets/enumerable/one.rb +1 -1
- data/lib/core/facets/enumerable/probability.rb +1 -1
- data/lib/core/facets/enumerable/sum.rb +1 -1
- data/lib/core/facets/enumerable/take.rb +20 -0
- data/lib/core/facets/enumerable/uniq_by.rb +0 -2
- data/lib/core/facets/exception/detail.rb +1 -1
- data/lib/core/facets/exception/suppress.rb +1 -2
- data/lib/core/facets/file/append.rb +1 -1
- data/lib/core/facets/file/create.rb +1 -1
- data/lib/core/facets/file/null.rb +1 -1
- data/lib/core/facets/file/read.rb +3 -3
- data/lib/core/facets/file/rewrite.rb +1 -1
- data/lib/core/facets/file/rootname.rb +1 -1
- data/lib/core/facets/file/split_all.rb +19 -0
- data/lib/core/facets/file/split_root.rb +3 -0
- data/lib/core/facets/file/write.rb +1 -1
- data/lib/core/facets/file/writelines.rb +1 -2
- data/lib/core/facets/filetest/root.rb +1 -1
- data/lib/core/facets/hash/alias.rb +1 -1
- data/lib/core/facets/hash/autonew.rb +1 -17
- data/lib/core/facets/hash/collate.rb +1 -1
- data/lib/core/facets/hash/delete.rb +3 -3
- data/lib/core/facets/hash/insert.rb +1 -1
- data/lib/core/facets/hash/inverse.rb +1 -1
- data/lib/core/facets/hash/join.rb +1 -1
- data/lib/core/facets/hash/keys.rb +3 -3
- data/lib/core/facets/hash/op_add.rb +1 -1
- data/lib/core/facets/hash/op_and.rb +1 -1
- data/lib/core/facets/hash/op_mul.rb +1 -1
- data/lib/core/facets/hash/op_or.rb +1 -1
- data/lib/core/facets/hash/op_push.rb +1 -1
- data/lib/core/facets/hash/op_sub.rb +1 -1
- data/lib/core/facets/hash/rekey.rb +11 -7
- data/lib/core/facets/hash/replace_each.rb +16 -0
- data/lib/core/facets/hash/select.rb +1 -2
- data/lib/{more → core}/facets/hash/stringify_keys.rb +0 -0
- data/lib/core/facets/hash/symbolize_keys.rb +94 -0
- data/lib/core/facets/hash/to_options.rb +1 -0
- data/lib/core/facets/hash/to_struct.rb +1 -1
- data/lib/core/facets/hash/traverse.rb +2 -2
- data/lib/core/facets/hash/update.rb +5 -80
- data/lib/core/facets/hash/update_each.rb +18 -0
- data/lib/core/facets/hash/update_keys.rb +20 -0
- data/lib/core/facets/hash/update_values.rb +20 -0
- data/lib/core/facets/hash/weave.rb +1 -1
- data/lib/core/facets/hash/zipnew.rb +17 -1
- data/lib/core/facets/integer/factorial.rb +1 -1
- data/lib/core/facets/integer/multiple.rb +1 -1
- data/lib/core/facets/integer/odd.rb +2 -2
- data/lib/core/facets/kernel/__here__.rb +8 -0
- data/lib/core/facets/kernel/as.rb +2 -2
- data/lib/core/facets/kernel/attr_singleton.rb +5 -5
- data/lib/core/facets/{callstack.rb → kernel/callstack.rb} +1 -1
- data/lib/core/facets/kernel/complete.rb +1 -1
- data/lib/core/facets/kernel/constant.rb +1 -1
- data/lib/core/facets/kernel/d.rb +1 -5
- data/lib/core/facets/kernel/demo.rb +2 -2
- data/lib/core/facets/kernel/ergo.rb +2 -2
- data/lib/core/facets/kernel/instance_class.rb +1 -1
- data/lib/core/facets/kernel/instance_variables.rb +2 -4
- data/lib/core/facets/kernel/not_nil.rb +1 -1
- data/lib/core/facets/kernel/object_send.rb +1 -1
- data/lib/core/facets/kernel/p.rb +1 -1
- data/lib/core/facets/kernel/populate.rb +2 -2
- data/lib/core/facets/kernel/qua_class.rb +2 -2
- data/lib/core/facets/kernel/resc.rb +1 -1
- data/lib/core/facets/kernel/respond.rb +1 -1
- data/lib/core/facets/kernel/returning.rb +1 -1
- data/lib/core/facets/kernel/silence.rb +4 -4
- data/lib/core/facets/kernel/try.rb +5 -3
- data/lib/core/facets/matchdata/match.rb +1 -1
- data/lib/core/facets/matchdata/matchset.rb +2 -2
- data/lib/core/facets/metaid.rb +5 -5
- data/lib/core/facets/module/abstract.rb +1 -1
- data/lib/core/facets/module/alias_accessor.rb +3 -3
- data/lib/core/facets/module/alias_method_chain.rb +1 -2
- data/lib/core/facets/module/alias_module_function.rb +1 -1
- data/lib/core/facets/module/ancestor.rb +1 -1
- data/lib/core/facets/module/basename.rb +1 -1
- data/lib/core/facets/module/conflict.rb +1 -2
- data/lib/core/facets/module/include_function_module.rb +1 -1
- data/lib/core/facets/module/instance_methods.rb +4 -6
- data/lib/core/facets/module/is.rb +2 -2
- data/lib/core/facets/module/modspace.rb +1 -1
- data/lib/core/facets/module/module_load.rb +2 -2
- data/lib/core/facets/module/nesting.rb +1 -1
- data/lib/core/facets/module/op.rb +3 -6
- data/lib/core/facets/module/prepend.rb +1 -1
- data/lib/core/facets/module/redefine_method.rb +1 -1
- data/lib/core/facets/module/rename_method.rb +1 -1
- data/lib/core/facets/module/revise.rb +2 -2
- data/lib/core/facets/module/spacename.rb +1 -1
- data/lib/core/facets/module/wrap_method.rb +1 -1
- data/lib/core/facets/nilclass/to_f.rb +1 -1
- data/lib/core/facets/numeric/approx.rb +1 -1
- data/lib/core/facets/numeric/distance.rb +1 -1
- data/lib/core/facets/numeric/round.rb +3 -6
- data/lib/core/facets/objectspace.rb +6 -0
- data/lib/core/facets/objectspace/classes.rb +11 -0
- data/lib/core/facets/proc/bind.rb +1 -1
- data/lib/core/facets/proc/compose.rb +2 -2
- data/lib/core/facets/proc/to_method.rb +1 -1
- data/lib/core/facets/proc/update.rb +1 -1
- data/lib/core/facets/range/combine.rb +2 -2
- data/lib/core/facets/range/overlap.rb +1 -2
- data/lib/core/facets/range/within.rb +2 -4
- data/lib/core/facets/regexp/arity.rb +1 -1
- data/lib/core/facets/string/align.rb +3 -3
- data/lib/core/facets/string/bracket.rb +6 -6
- data/lib/core/facets/string/camelcase.rb +1 -1
- data/lib/core/facets/string/capitalized.rb +3 -3
- data/lib/core/facets/string/chars.rb +1 -1
- data/lib/core/facets/string/chomp.rb +2 -2
- data/lib/core/facets/string/cleave.rb +1 -1
- data/lib/core/facets/string/compress_lines.rb +17 -0
- data/lib/core/facets/string/contains.rb +7 -0
- data/lib/core/facets/string/divide.rb +1 -1
- data/lib/core/facets/string/expand_tab.rb +35 -0
- data/lib/core/facets/string/fold.rb +1 -1
- data/lib/core/facets/string/indent.rb +25 -0
- data/lib/core/facets/string/interpolate.rb +1 -1
- data/lib/core/facets/string/line_wrap.rb +1 -1
- data/lib/core/facets/string/lines.rb +1 -2
- data/lib/core/facets/string/margin.rb +30 -0
- data/lib/core/facets/string/methodize.rb +1 -1
- data/lib/core/facets/string/mscan.rb +1 -1
- data/lib/core/facets/string/natcmp.rb +1 -2
- data/lib/core/facets/string/nchar.rb +0 -2
- data/lib/core/facets/string/op_sub.rb +1 -1
- data/lib/core/facets/string/outdent.rb +1 -0
- data/lib/core/facets/string/range.rb +4 -5
- data/lib/core/facets/string/rewrite.rb +1 -1
- data/lib/core/facets/string/shatter.rb +1 -1
- data/lib/core/facets/string/snakecase.rb +1 -1
- data/lib/core/facets/string/splice.rb +2 -2
- data/lib/core/facets/string/start_with.rb +2 -4
- data/lib/core/facets/string/tab.rb +9 -92
- data/lib/core/facets/string/tabto.rb +19 -0
- data/lib/core/facets/string/titlecase.rb +1 -1
- data/lib/core/facets/string/to_re.rb +2 -2
- data/lib/core/facets/string/word_wrap.rb +2 -4
- data/lib/core/facets/struct.rb +6 -0
- data/lib/core/facets/struct/attributes.rb +11 -0
- data/lib/core/facets/symbol/chomp.rb +2 -2
- data/lib/core/facets/symbol/generate.rb +1 -1
- data/lib/core/facets/symbol/not.rb +2 -2
- data/lib/core/facets/symbol/succ.rb +1 -1
- data/lib/core/facets/symbol/to_proc.rb +2 -3
- data/lib/core/facets/time/advance.rb +2 -1
- data/lib/core/facets/time/elapse.rb +1 -1
- data/lib/core/facets/time/hence.rb +16 -13
- data/lib/core/facets/time/stamp.rb +2 -2
- data/lib/core/facets/to_hash.rb +1 -1
- data/lib/core/facets/unboundmethod/arguments.rb +1 -1
- data/lib/core/facets/unboundmethod/name.rb +1 -1
- data/lib/lore/facets/date.rb +2 -2
- data/lib/lore/facets/enumerator.rb +67 -0
- data/lib/lore/facets/ostruct.rb +3 -7
- data/lib/more/facets/attr.rb +10 -9
- data/lib/more/facets/consoleutils.rb +1 -15
- data/lib/more/facets/dependency.rb +1 -1
- data/lib/more/facets/duration.rb +271 -525
- data/lib/more/facets/filter.rb +121 -0
- data/lib/more/facets/inheritor.rb +37 -58
- data/lib/more/facets/iteration.rb +1 -1
- data/lib/more/facets/kernel/meta.rb +1 -1
- data/lib/more/facets/{dictionarymatcher.rb → matcher.rb} +15 -11
- data/lib/more/facets/memoize.rb +9 -12
- data/lib/more/facets/memoizer.rb +74 -0
- data/lib/more/facets/multipliers.rb +54 -66
- data/lib/more/facets/nilstatus.rb +3 -2
- data/lib/more/facets/openmodule.rb +15 -0
- data/lib/more/facets/opesc.rb +1 -1
- data/lib/more/facets/ostructable.rb +212 -0
- data/lib/more/facets/pathlist.rb +1 -0
- data/lib/more/facets/sparse_array.rb +809 -0
- data/lib/more/facets/stash.rb +66 -0
- data/lib/more/facets/string/words.rb +8 -11
- data/lib/more/facets/succ.rb +3 -3
- data/lib/more/facets/thread.rb +2 -2
- data/lib/more/facets/ziputils.rb +238 -97
- data/test/core/array/test_index.rb +17 -0
- data/test/core/class/test_cattr.rb +1 -1
- data/test/core/class/test_to_proc.rb +13 -0
- data/test/core/comparable/test_cap.rb +25 -0
- data/test/core/comparable/{test_bound.rb → test_clip.rb} +1 -20
- data/test/core/file/test_split_all.rb +32 -0
- data/test/core/hash/test_op_mul.rb +1 -1
- data/test/core/hash/test_op_push.rb +7 -0
- data/test/core/hash/test_replace_each.rb +14 -0
- data/test/core/hash/test_update_each.rb +13 -0
- data/test/core/hash/test_update_keys.rb +18 -0
- data/test/core/hash/test_update_values.rb +12 -0
- data/test/core/kernel/test_callstack.rb +1 -1
- data/test/core/string/test_indent.rb +13 -0
- data/test/core/string/test_margin.rb +100 -0
- data/test/core/string/test_outdent.rb +65 -0
- data/test/core/string/test_tab.rb +1 -162
- data/test/core/string/test_tabto.rb +13 -0
- data/test/{more → core}/test_metaid.rb +8 -8
- data/test/core/time/test_hence.rb +118 -4
- data/test/core/unboundmethod/test_name.rb +1 -1
- data/test/more/{test_arguments.rb → test_argvector.rb} +8 -12
- data/test/more/test_filter.rb +87 -0
- data/test/more/test_memoize.rb +11 -9
- data/test/more/test_sparsearray.rb +279 -0
- metadata +741 -725
- data/demo/bench/bench_load.rb +0 -56
- data/demo/bench/enumerable/bench_collect.rb +0 -84
- data/demo/bench/enumerable/bench_count.rb +0 -58
- data/demo/bench/general/bench_calls.rb +0 -74
- data/demo/bench/general/bench_includes.rb +0 -25
- data/demo/bench/general/bench_methods.rb +0 -17
- data/demo/bench/general/bench_pathname.rb +0 -24
- data/demo/bench/general/bench_range.rb +0 -64
- data/demo/bench/general/bench_return.rb +0 -56
- data/demo/bench/general/bench_yeild.rb +0 -75
- data/demo/bench/general/comment_loading/bench.rb +0 -46
- data/demo/bench/general/comment_loading/comments_begin.rb +0 -109
- data/demo/bench/general/comment_loading/comments_end.rb +0 -127
- data/demo/bench/general/comment_loading/comments_none.rb +0 -1
- data/demo/bench/general/comment_loading/comments_sharp.rb +0 -125
- data/demo/bench/integer/bench_factorial.rb +0 -31
- data/demo/sample/annotations/annotations1.rb +0 -22
- data/demo/sample/ansicolor/cdiff.rb +0 -20
- data/demo/sample/ansicolor/example.rb +0 -82
- data/doc/book/notes.rdoc +0 -9
- data/doc/rdoc/more/classes/BigDuration.html +0 -323
- data/doc/rdoc/more/classes/CLI/Arguments.html +0 -488
- data/doc/rdoc/more/classes/CLI/Command.html +0 -316
- data/doc/rdoc/more/classes/Chain.html +0 -206
- data/doc/rdoc/more/classes/FileShell.html +0 -743
- data/doc/rdoc/more/classes/TagIterator.html +0 -581
- data/doc/rdoc/more/classes/UploadUtils.html +0 -497
- data/doc/rdoc/more/classes/Weekdays.html +0 -218
- data/doc/rdoc/more/files/lib/more/facets/annotations_rb.html +0 -180
- data/doc/rdoc/more/files/lib/more/facets/arguments_rb.html +0 -142
- data/doc/rdoc/more/files/lib/more/facets/cattr_rb.html +0 -125
- data/doc/rdoc/more/files/lib/more/facets/chain_rb.html +0 -114
- data/doc/rdoc/more/files/lib/more/facets/command_rb.html +0 -170
- data/doc/rdoc/more/files/lib/more/facets/eventhook_rb.html +0 -141
- data/doc/rdoc/more/files/lib/more/facets/tagiterator_rb.html +0 -111
- data/doc/rdoc/more/files/lib/more/facets/times_rb.html +0 -163
- data/doc/rdoc/more/files/lib/more/facets/uploadutils_rb.html +0 -176
- data/lib/more/facets/annotations.rb +0 -302
- data/lib/more/facets/arguments.rb +0 -365
- data/lib/more/facets/bytes.rb +0 -175
- data/lib/more/facets/cachedecorator.rb +0 -117
- data/lib/more/facets/chain.rb +0 -58
- data/lib/more/facets/command.rb +0 -439
- data/lib/more/facets/eventhook.rb +0 -132
- data/lib/more/facets/fileshell.rb +0 -202
- data/lib/more/facets/hash/symbolize_keys.rb +0 -94
- data/lib/more/facets/tagiter.rb +0 -366
- data/lib/more/facets/times.rb +0 -431
- data/lib/more/facets/uploadutils.rb +0 -464
- data/test/core/hash/test_update.rb +0 -46
- data/test/more/test_annotations.rb +0 -120
- data/test/more/test_bytes.rb +0 -71
- data/test/more/test_command.rb +0 -69
- data/test/more/test_times.rb +0 -89
@@ -86,9 +86,9 @@ Wee::Component.
|
|
86
86
|
|
87
87
|
|
88
88
|
<div class="sectiontitle">Methods</div>
|
89
|
-
<span style="padding-right: 5px;"><a href="#
|
90
|
-
<span style="padding-right: 5px;"><a href="#
|
91
|
-
<span style="padding-right: 5px;"><a href="#
|
89
|
+
<span style="padding-right: 5px;"><a href="#M000064">new</a></span>
|
90
|
+
<span style="padding-right: 5px;"><a href="#M000066">restore_snapshot</a></span>
|
91
|
+
<span style="padding-right: 5px;"><a href="#M000065">take_snapshot</a></span>
|
92
92
|
|
93
93
|
|
94
94
|
|
@@ -108,11 +108,11 @@ Wee::Component.
|
|
108
108
|
<div class="sectiontitle">Public Class methods</div>
|
109
109
|
<div class="method">
|
110
110
|
<div class="title">
|
111
|
-
<a name="
|
111
|
+
<a name="M000064"></a><b>new</b>(value=nil)
|
112
112
|
</div>
|
113
113
|
<div class="sourcecode">
|
114
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
115
|
-
<div id="
|
114
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">+</a> ]</p>
|
115
|
+
<div id="M000064_source" class="dyn-source">
|
116
116
|
<pre>
|
117
117
|
<span class="ruby-comment cmt"># File lib/more/facets/snapshot.rb, line 140</span>
|
118
118
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -125,11 +125,11 @@ Wee::Component.
|
|
125
125
|
<div class="sectiontitle">Public Instance methods</div>
|
126
126
|
<div class="method">
|
127
127
|
<div class="title">
|
128
|
-
<a name="
|
128
|
+
<a name="M000066"></a><b>restore_snapshot</b>(value)
|
129
129
|
</div>
|
130
130
|
<div class="sourcecode">
|
131
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
132
|
-
<div id="
|
131
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">+</a> ]</p>
|
132
|
+
<div id="M000066_source" class="dyn-source">
|
133
133
|
<pre>
|
134
134
|
<span class="ruby-comment cmt"># File lib/more/facets/snapshot.rb, line 148</span>
|
135
135
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">restore_snapshot</span>(<span class="ruby-identifier">value</span>)
|
@@ -141,11 +141,11 @@ Wee::Component.
|
|
141
141
|
</div>
|
142
142
|
<div class="method">
|
143
143
|
<div class="title">
|
144
|
-
<a name="
|
144
|
+
<a name="M000065"></a><b>take_snapshot</b>()
|
145
145
|
</div>
|
146
146
|
<div class="sourcecode">
|
147
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
148
|
-
<div id="
|
147
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">+</a> ]</p>
|
148
|
+
<div id="M000065_source" class="dyn-source">
|
149
149
|
<pre>
|
150
150
|
<span class="ruby-comment cmt"># File lib/more/facets/snapshot.rb, line 144</span>
|
151
151
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">take_snapshot</span>
|
@@ -0,0 +1,1397 @@
|
|
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: SparseArray</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 />SparseArray</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/more/facets/sparse_array_rb.html">lib/more/facets/sparse_array.rb</a>
|
61
|
+
</td>
|
62
|
+
</tr>
|
63
|
+
<tr>
|
64
|
+
<td>Parent:</td>
|
65
|
+
<td>
|
66
|
+
<a href="Hash.html">
|
67
|
+
Hash
|
68
|
+
</a>
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</td>
|
73
|
+
</tr>
|
74
|
+
</table>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
<div id="content">
|
79
|
+
|
80
|
+
<div class="description"><p>
|
81
|
+
<a href="SparseArray.html">SparseArray</a> is an implemenation of the Array
|
82
|
+
class using only Hashes. Regular Arrays are never used except once to
|
83
|
+
delegate the <a href="SparseArray.html#M000355">pack</a> method, and for
|
84
|
+
*args parameters (since there is no way around those is some cases). <a
|
85
|
+
href="SparseArray.html">SparseArray</a> is for all practical purposes 100%
|
86
|
+
compatible with Array.
|
87
|
+
</p>
|
88
|
+
<p>
|
89
|
+
<a href="SparseArray.html">SparseArray</a> is slower then the built in
|
90
|
+
Array class, but not as slow as one might expect, since a <a
|
91
|
+
href="Hash.html">Hash</a> in general is faster than an Array. <a
|
92
|
+
href="It.html">It</a> might be interesting to see how this would perform if
|
93
|
+
it were written in c. Not all that useful, but an interesting example.
|
94
|
+
</p>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<div class="sectiontitle">Methods</div>
|
100
|
+
<span style="padding-right: 5px;"><a href="#M000322">&</a></span>
|
101
|
+
<span style="padding-right: 5px;"><a href="#M000323">*</a></span>
|
102
|
+
<span style="padding-right: 5px;"><a href="#M000324">+</a></span>
|
103
|
+
<span style="padding-right: 5px;"><a href="#M000325">-</a></span>
|
104
|
+
<span style="padding-right: 5px;"><a href="#M000326"><<</a></span>
|
105
|
+
<span style="padding-right: 5px;"><a href="#M000327"><=></a></span>
|
106
|
+
<span style="padding-right: 5px;"><a href="#M000328">===</a></span>
|
107
|
+
<span style="padding-right: 5px;"><a href="#M000319">[]</a></span>
|
108
|
+
<span style="padding-right: 5px;"><a href="#M000329">[]</a></span>
|
109
|
+
<span style="padding-right: 5px;"><a href="#M000330">[]=</a></span>
|
110
|
+
<span style="padding-right: 5px;"><a href="#M000332">assoc</a></span>
|
111
|
+
<span style="padding-right: 5px;"><a href="#M000333">at</a></span>
|
112
|
+
<span style="padding-right: 5px;"><a href="#M000334">collect</a></span>
|
113
|
+
<span style="padding-right: 5px;"><a href="#M000335">collect!</a></span>
|
114
|
+
<span style="padding-right: 5px;"><a href="#M000336">compact</a></span>
|
115
|
+
<span style="padding-right: 5px;"><a href="#M000337">compact!</a></span>
|
116
|
+
<span style="padding-right: 5px;"><a href="#M000338">concat</a></span>
|
117
|
+
<span style="padding-right: 5px;"><a href="#M000339">count</a></span>
|
118
|
+
<span style="padding-right: 5px;"><a href="#M000340">delete</a></span>
|
119
|
+
<span style="padding-right: 5px;"><a href="#M000341">delete_at</a></span>
|
120
|
+
<span style="padding-right: 5px;"><a href="#M000342">delete_if</a></span>
|
121
|
+
<span style="padding-right: 5px;"><a href="#M000343">each</a></span>
|
122
|
+
<span style="padding-right: 5px;"><a href="#M000344">each_index</a></span>
|
123
|
+
<span style="padding-right: 5px;"><a href="#M000345">eql?</a></span>
|
124
|
+
<span style="padding-right: 5px;"><a href="#M000346">fill</a></span>
|
125
|
+
<span style="padding-right: 5px;"><a href="#M000347">first</a></span>
|
126
|
+
<span style="padding-right: 5px;"><a href="#M000348">flatten</a></span>
|
127
|
+
<span style="padding-right: 5px;"><a href="#M000349">flatten!</a></span>
|
128
|
+
<span style="padding-right: 5px;"><a href="#M000350">include?</a></span>
|
129
|
+
<span style="padding-right: 5px;"><a href="#M000351">join</a></span>
|
130
|
+
<span style="padding-right: 5px;"><a href="#M000352">last</a></span>
|
131
|
+
<span style="padding-right: 5px;"><a href="#M000353">map!</a></span>
|
132
|
+
<span style="padding-right: 5px;"><a href="#M000321">new</a></span>
|
133
|
+
<span style="padding-right: 5px;"><a href="#M000320">new_h</a></span>
|
134
|
+
<span style="padding-right: 5px;"><a href="#M000354">nitems</a></span>
|
135
|
+
<span style="padding-right: 5px;"><a href="#M000355">pack</a></span>
|
136
|
+
<span style="padding-right: 5px;"><a href="#M000356">pop</a></span>
|
137
|
+
<span style="padding-right: 5px;"><a href="#M000357">push</a></span>
|
138
|
+
<span style="padding-right: 5px;"><a href="#M000370">qsort</a></span>
|
139
|
+
<span style="padding-right: 5px;"><a href="#M000358">rassoc</a></span>
|
140
|
+
<span style="padding-right: 5px;"><a href="#M000359">reindex</a></span>
|
141
|
+
<span style="padding-right: 5px;"><a href="#M000360">reindex!</a></span>
|
142
|
+
<span style="padding-right: 5px;"><a href="#M000361">reject!</a></span>
|
143
|
+
<span style="padding-right: 5px;"><a href="#M000362">reverse</a></span>
|
144
|
+
<span style="padding-right: 5px;"><a href="#M000363">reverse!</a></span>
|
145
|
+
<span style="padding-right: 5px;"><a href="#M000364">reverse_each</a></span>
|
146
|
+
<span style="padding-right: 5px;"><a href="#M000365">rindex</a></span>
|
147
|
+
<span style="padding-right: 5px;"><a href="#M000366">shift</a></span>
|
148
|
+
<span style="padding-right: 5px;"><a href="#M000367">slice</a></span>
|
149
|
+
<span style="padding-right: 5px;"><a href="#M000368">slice!</a></span>
|
150
|
+
<span style="padding-right: 5px;"><a href="#M000369">sort</a></span>
|
151
|
+
<span style="padding-right: 5px;"><a href="#M000371">sort!</a></span>
|
152
|
+
<span style="padding-right: 5px;"><a href="#M000372">to_a</a></span>
|
153
|
+
<span style="padding-right: 5px;"><a href="#M000373">to_ary</a></span>
|
154
|
+
<span style="padding-right: 5px;"><a href="#M000374">to_h</a></span>
|
155
|
+
<span style="padding-right: 5px;"><a href="#M000375">to_s</a></span>
|
156
|
+
<span style="padding-right: 5px;"><a href="#M000376">uniq</a></span>
|
157
|
+
<span style="padding-right: 5px;"><a href="#M000377">uniq!</a></span>
|
158
|
+
<span style="padding-right: 5px;"><a href="#M000378">unshift</a></span>
|
159
|
+
<span style="padding-right: 5px;"><a href="#M000379">values_at</a></span>
|
160
|
+
<span style="padding-right: 5px;"><a href="#M000331">|</a></span>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<div class="sectiontitle">Public Class methods</div>
|
168
|
+
<div class="method">
|
169
|
+
<div class="title">
|
170
|
+
<a name="M000319"></a><b>[]</b>(*args)
|
171
|
+
</div>
|
172
|
+
<div class="sourcecode">
|
173
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000319_source')" id="l_M000319_source">+</a> ]</p>
|
174
|
+
<div id="M000319_source" class="dyn-source">
|
175
|
+
<pre>
|
176
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 40</span>
|
177
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
178
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-identifier">new</span>
|
179
|
+
<span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">nha</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">length</span>,<span class="ruby-identifier">a</span>) }
|
180
|
+
<span class="ruby-identifier">nha</span>
|
181
|
+
<span class="ruby-keyword kw">end</span>
|
182
|
+
</pre>
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
<div class="method">
|
187
|
+
<div class="title">
|
188
|
+
<a name="M000321"></a><b>new</b>(i=0,e=nil)
|
189
|
+
</div>
|
190
|
+
<div class="sourcecode">
|
191
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000321_source')" id="l_M000321_source">+</a> ]</p>
|
192
|
+
<div id="M000321_source" class="dyn-source">
|
193
|
+
<pre>
|
194
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 52</span>
|
195
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">i</span>=<span class="ruby-value">0</span>,<span class="ruby-identifier">e</span>=<span class="ruby-keyword kw">nil</span>)
|
196
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
197
|
+
<span class="ruby-identifier">i</span>.<span class="ruby-identifier">times</span> { <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>,<span class="ruby-identifier">e</span>) }
|
198
|
+
<span class="ruby-keyword kw">end</span>
|
199
|
+
<span class="ruby-keyword kw">end</span>
|
200
|
+
</pre>
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
</div>
|
204
|
+
<div class="method">
|
205
|
+
<div class="title">
|
206
|
+
<a name="M000320"></a><b>new_h</b>(hsh)
|
207
|
+
</div>
|
208
|
+
<div class="sourcecode">
|
209
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000320_source')" id="l_M000320_source">+</a> ]</p>
|
210
|
+
<div id="M000320_source" class="dyn-source">
|
211
|
+
<pre>
|
212
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 46</span>
|
213
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new_h</span>(<span class="ruby-identifier">hsh</span>)
|
214
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-identifier">new</span>
|
215
|
+
<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">hsh</span>)
|
216
|
+
<span class="ruby-comment cmt">#nha.reindex!</span>
|
217
|
+
<span class="ruby-keyword kw">end</span>
|
218
|
+
</pre>
|
219
|
+
</div>
|
220
|
+
</div>
|
221
|
+
</div>
|
222
|
+
<div class="sectiontitle">Public Instance methods</div>
|
223
|
+
<div class="method">
|
224
|
+
<div class="title">
|
225
|
+
<a name="M000322"></a><b>&</b>(ha)
|
226
|
+
</div>
|
227
|
+
<div class="sourcecode">
|
228
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000322_source')" id="l_M000322_source">+</a> ]</p>
|
229
|
+
<div id="M000322_source" class="dyn-source">
|
230
|
+
<pre>
|
231
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 58</span>
|
232
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">&</span>(<span class="ruby-identifier">ha</span>)
|
233
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
|
234
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</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>
|
235
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ha</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) <span class="ruby-keyword kw">and</span> <span class="ruby-operator">!</span><span class="ruby-identifier">nha</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>))
|
236
|
+
<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">length</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>))
|
237
|
+
<span class="ruby-keyword kw">end</span>
|
238
|
+
<span class="ruby-keyword kw">end</span>
|
239
|
+
<span class="ruby-identifier">nha</span>
|
240
|
+
<span class="ruby-keyword kw">end</span>
|
241
|
+
</pre>
|
242
|
+
</div>
|
243
|
+
</div>
|
244
|
+
</div>
|
245
|
+
<div class="method">
|
246
|
+
<div class="title">
|
247
|
+
<a name="M000323"></a><b>*</b>(j)
|
248
|
+
</div>
|
249
|
+
<div class="sourcecode">
|
250
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000323_source')" id="l_M000323_source">+</a> ]</p>
|
251
|
+
<div id="M000323_source" class="dyn-source">
|
252
|
+
<pre>
|
253
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 68</span>
|
254
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">*</span>(<span class="ruby-identifier">j</span>)
|
255
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">j</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>)
|
256
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">j</span>)
|
257
|
+
<span class="ruby-keyword kw">else</span>
|
258
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
|
259
|
+
<span class="ruby-identifier">j</span>.<span class="ruby-identifier">times</span> { (<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">nha</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">length</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) } }
|
260
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">nha</span>
|
261
|
+
<span class="ruby-keyword kw">end</span>
|
262
|
+
<span class="ruby-keyword kw">end</span>
|
263
|
+
</pre>
|
264
|
+
</div>
|
265
|
+
</div>
|
266
|
+
</div>
|
267
|
+
<div class="method">
|
268
|
+
<div class="title">
|
269
|
+
<a name="M000324"></a><b>+</b>(ha)
|
270
|
+
</div>
|
271
|
+
<div class="sourcecode">
|
272
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000324_source')" id="l_M000324_source">+</a> ]</p>
|
273
|
+
<div id="M000324_source" class="dyn-source">
|
274
|
+
<pre>
|
275
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 78</span>
|
276
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">+</span>(<span class="ruby-identifier">ha</span>)
|
277
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
|
278
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">ha</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">nha</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">length</span>,<span class="ruby-identifier">ha</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) }
|
279
|
+
<span class="ruby-identifier">nha</span>
|
280
|
+
<span class="ruby-keyword kw">end</span>
|
281
|
+
</pre>
|
282
|
+
</div>
|
283
|
+
</div>
|
284
|
+
</div>
|
285
|
+
<div class="method">
|
286
|
+
<div class="title">
|
287
|
+
<a name="M000325"></a><b>-</b>(ha)
|
288
|
+
</div>
|
289
|
+
<div class="sourcecode">
|
290
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000325_source')" id="l_M000325_source">+</a> ]</p>
|
291
|
+
<div id="M000325_source" class="dyn-source">
|
292
|
+
<pre>
|
293
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 84</span>
|
294
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">-</span>(<span class="ruby-identifier">ha</span>)
|
295
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
|
296
|
+
<span class="ruby-keyword kw">self</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">nha</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">v</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">ha</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-identifier">v</span>) }
|
297
|
+
<span class="ruby-comment cmt">#ha.each { |v| nha << i if !self.include?(v) }</span>
|
298
|
+
<span class="ruby-identifier">nha</span>
|
299
|
+
<span class="ruby-keyword kw">end</span>
|
300
|
+
</pre>
|
301
|
+
</div>
|
302
|
+
</div>
|
303
|
+
</div>
|
304
|
+
<div class="method">
|
305
|
+
<div class="title">
|
306
|
+
<a name="M000326"></a><b><<</b>(e)
|
307
|
+
</div>
|
308
|
+
<div class="sourcecode">
|
309
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000326_source')" id="l_M000326_source">+</a> ]</p>
|
310
|
+
<div id="M000326_source" class="dyn-source">
|
311
|
+
<pre>
|
312
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 91</span>
|
313
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator"><<</span>(<span class="ruby-identifier">e</span>)
|
314
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>,<span class="ruby-identifier">e</span>)
|
315
|
+
<span class="ruby-keyword kw">self</span>
|
316
|
+
<span class="ruby-keyword kw">end</span>
|
317
|
+
</pre>
|
318
|
+
</div>
|
319
|
+
</div>
|
320
|
+
</div>
|
321
|
+
<div class="method">
|
322
|
+
<div class="title">
|
323
|
+
<a name="M000327"></a><b><=></b>(ha)
|
324
|
+
</div>
|
325
|
+
<div class="sourcecode">
|
326
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000327_source')" id="l_M000327_source">+</a> ]</p>
|
327
|
+
<div id="M000327_source" class="dyn-source">
|
328
|
+
<pre>
|
329
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 96</span>
|
330
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator"><=></span>(<span class="ruby-identifier">ha</span>)
|
331
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</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>
|
332
|
+
<span class="ruby-identifier">ieq</span> = (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>) <span class="ruby-operator"><=></span> <span class="ruby-identifier">ha</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>))
|
333
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ieq</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ieq</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
|
334
|
+
<span class="ruby-keyword kw">end</span>
|
335
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">ha</span>.<span class="ruby-identifier">length</span>
|
336
|
+
<span class="ruby-keyword kw">end</span>
|
337
|
+
</pre>
|
338
|
+
</div>
|
339
|
+
</div>
|
340
|
+
</div>
|
341
|
+
<div class="method">
|
342
|
+
<div class="title">
|
343
|
+
<a name="M000328"></a><b>===</b>(ha)
|
344
|
+
</div>
|
345
|
+
<div class="sourcecode">
|
346
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000328_source')" id="l_M000328_source">+</a> ]</p>
|
347
|
+
<div id="M000328_source" class="dyn-source">
|
348
|
+
<pre>
|
349
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 104</span>
|
350
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">===</span>(<span class="ruby-identifier">ha</span>)
|
351
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-operator">==</span>(<span class="ruby-identifier">ha</span>)
|
352
|
+
<span class="ruby-keyword kw">end</span>
|
353
|
+
</pre>
|
354
|
+
</div>
|
355
|
+
</div>
|
356
|
+
</div>
|
357
|
+
<div class="method">
|
358
|
+
<div class="title">
|
359
|
+
<a name="M000329"></a><b>[]</b>(i,l=nil)
|
360
|
+
</div>
|
361
|
+
<div class="sourcecode">
|
362
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000329_source')" id="l_M000329_source">+</a> ]</p>
|
363
|
+
<div id="M000329_source" class="dyn-source">
|
364
|
+
<pre>
|
365
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 111</span>
|
366
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">i</span>,<span class="ruby-identifier">l</span>=<span class="ruby-keyword kw">nil</span>)
|
367
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">l</span>
|
368
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-identifier">i</span><span class="ruby-operator">...</span><span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-identifier">l</span>
|
369
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Range</span>)
|
370
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">at</span>(<span class="ruby-identifier">i</span>)
|
371
|
+
<span class="ruby-keyword kw">end</span>
|
372
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
|
373
|
+
<span class="ruby-identifier">i</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">nha</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">length</span>,<span class="ruby-identifier">get</span>(<span class="ruby-identifier">j</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">j</span>) }
|
374
|
+
<span class="ruby-identifier">nha</span>
|
375
|
+
<span class="ruby-keyword kw">end</span>
|
376
|
+
</pre>
|
377
|
+
</div>
|
378
|
+
</div>
|
379
|
+
</div>
|
380
|
+
<div class="method">
|
381
|
+
<div class="title">
|
382
|
+
<a name="M000330"></a><b>[]=</b>(i,b,c=nil)
|
383
|
+
</div>
|
384
|
+
<div class="sourcecode">
|
385
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000330_source')" id="l_M000330_source">+</a> ]</p>
|
386
|
+
<div id="M000330_source" class="dyn-source">
|
387
|
+
<pre>
|
388
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 123</span>
|
389
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">i</span>,<span class="ruby-identifier">b</span>,<span class="ruby-identifier">c</span>=<span class="ruby-keyword kw">nil</span>)
|
390
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span>
|
391
|
+
<span class="ruby-identifier">rng</span> = (<span class="ruby-constant">Integer</span>(<span class="ruby-identifier">i</span>)<span class="ruby-operator">..</span><span class="ruby-constant">Integer</span>(<span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-identifier">b</span>))
|
392
|
+
<span class="ruby-identifier">b</span> = <span class="ruby-identifier">c</span>
|
393
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Range</span>
|
394
|
+
<span class="ruby-identifier">rng</span> = <span class="ruby-identifier">i</span>
|
395
|
+
<span class="ruby-keyword kw">else</span>
|
396
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-constant">Integer</span>(<span class="ruby-identifier">i</span>),<span class="ruby-identifier">b</span>)
|
397
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">b</span>
|
398
|
+
<span class="ruby-keyword kw">end</span>
|
399
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">b</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
400
|
+
<span class="ruby-identifier">rng</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">qdelete</span>(<span class="ruby-identifier">i</span>) }
|
401
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">reindex!</span>
|
402
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
|
403
|
+
<span class="ruby-identifier">j</span> = <span class="ruby-value">0</span>
|
404
|
+
<span class="ruby-identifier">rng</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-identifier">b</span>[<span class="ruby-identifier">j</span>]; <span class="ruby-identifier">j</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span> }
|
405
|
+
<span class="ruby-keyword kw">else</span>
|
406
|
+
<span class="ruby-identifier">rng</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">qdelete</span>(<span class="ruby-identifier">i</span>) }
|
407
|
+
<span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">rng</span>.<span class="ruby-identifier">fist</span>] = <span class="ruby-identifier">b</span>
|
408
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">reindex!</span>
|
409
|
+
<span class="ruby-keyword kw">end</span>
|
410
|
+
<span class="ruby-keyword kw">end</span>
|
411
|
+
</pre>
|
412
|
+
</div>
|
413
|
+
</div>
|
414
|
+
</div>
|
415
|
+
<div class="method">
|
416
|
+
<div class="title">
|
417
|
+
<a name="M000332"></a><b>assoc</b>(k)
|
418
|
+
</div>
|
419
|
+
<div class="sourcecode">
|
420
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000332_source')" id="l_M000332_source">+</a> ]</p>
|
421
|
+
<div id="M000332_source" class="dyn-source">
|
422
|
+
<pre>
|
423
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 152</span>
|
424
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assoc</span>(<span class="ruby-identifier">k</span>)
|
425
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">k</span> }
|
426
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
427
|
+
<span class="ruby-keyword kw">end</span>
|
428
|
+
</pre>
|
429
|
+
</div>
|
430
|
+
</div>
|
431
|
+
</div>
|
432
|
+
<div class="method">
|
433
|
+
<div class="title">
|
434
|
+
<a name="M000333"></a><b>at</b>(i)
|
435
|
+
</div>
|
436
|
+
<div class="sourcecode">
|
437
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000333_source')" id="l_M000333_source">+</a> ]</p>
|
438
|
+
<div id="M000333_source" class="dyn-source">
|
439
|
+
<pre>
|
440
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 157</span>
|
441
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">at</span>(<span class="ruby-identifier">i</span>)
|
442
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator"><=</span> <span class="ruby-value">-1</span>
|
443
|
+
<span class="ruby-identifier">get</span>(<span class="ruby-identifier">i</span>)
|
444
|
+
<span class="ruby-comment cmt">#return nil if i < 0 or i >= self.length</span>
|
445
|
+
<span class="ruby-comment cmt">#return self.fetch(i)</span>
|
446
|
+
<span class="ruby-keyword kw">end</span>
|
447
|
+
</pre>
|
448
|
+
</div>
|
449
|
+
</div>
|
450
|
+
</div>
|
451
|
+
<div class="method">
|
452
|
+
<div class="title">
|
453
|
+
<a name="M000334"></a><b>collect</b>() {|self.fetch(i)| ...}
|
454
|
+
</div>
|
455
|
+
<div class="description">
|
456
|
+
<p>
|
457
|
+
clear okay
|
458
|
+
</p>
|
459
|
+
</div>
|
460
|
+
<div class="sourcecode">
|
461
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000334_source')" id="l_M000334_source">+</a> ]</p>
|
462
|
+
<div id="M000334_source" class="dyn-source">
|
463
|
+
<pre>
|
464
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 166</span>
|
465
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collect</span>
|
466
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
|
467
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">nha</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) }
|
468
|
+
<span class="ruby-identifier">nha</span>
|
469
|
+
<span class="ruby-keyword kw">end</span>
|
470
|
+
</pre>
|
471
|
+
</div>
|
472
|
+
</div>
|
473
|
+
</div>
|
474
|
+
<div class="method">
|
475
|
+
<div class="title">
|
476
|
+
<a name="M000335"></a><b>collect!</b>() {|self.fetch(i)| ...}
|
477
|
+
</div>
|
478
|
+
<div class="aka">
|
479
|
+
This method is also aliased as
|
480
|
+
<a href="SparseArray.html#M000353">map!</a>
|
481
|
+
</div>
|
482
|
+
<div class="sourcecode">
|
483
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000335_source')" id="l_M000335_source">+</a> ]</p>
|
484
|
+
<div id="M000335_source" class="dyn-source">
|
485
|
+
<pre>
|
486
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 172</span>
|
487
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collect!</span>
|
488
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
|
489
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">nha</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) }
|
490
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">nha</span>)
|
491
|
+
<span class="ruby-keyword kw">end</span>
|
492
|
+
</pre>
|
493
|
+
</div>
|
494
|
+
</div>
|
495
|
+
</div>
|
496
|
+
<div class="method">
|
497
|
+
<div class="title">
|
498
|
+
<a name="M000336"></a><b>compact</b>()
|
499
|
+
</div>
|
500
|
+
<div class="sourcecode">
|
501
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000336_source')" id="l_M000336_source">+</a> ]</p>
|
502
|
+
<div id="M000336_source" class="dyn-source">
|
503
|
+
<pre>
|
504
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 178</span>
|
505
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compact</span>
|
506
|
+
<span class="ruby-identifier">nha</span>, <span class="ruby-identifier">j</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value">0</span>
|
507
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</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>
|
508
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>) <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
509
|
+
<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">j</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>))
|
510
|
+
<span class="ruby-identifier">j</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>
|
511
|
+
<span class="ruby-keyword kw">end</span>
|
512
|
+
<span class="ruby-keyword kw">end</span>
|
513
|
+
<span class="ruby-identifier">nha</span>
|
514
|
+
<span class="ruby-keyword kw">end</span>
|
515
|
+
</pre>
|
516
|
+
</div>
|
517
|
+
</div>
|
518
|
+
</div>
|
519
|
+
<div class="method">
|
520
|
+
<div class="title">
|
521
|
+
<a name="M000337"></a><b>compact!</b>()
|
522
|
+
</div>
|
523
|
+
<div class="sourcecode">
|
524
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000337_source')" id="l_M000337_source">+</a> ]</p>
|
525
|
+
<div id="M000337_source" class="dyn-source">
|
526
|
+
<pre>
|
527
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 189</span>
|
528
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compact!</span>
|
529
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-keyword kw">nil</span>)
|
530
|
+
<span class="ruby-identifier">nha</span>, <span class="ruby-identifier">j</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value">0</span>
|
531
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</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>
|
532
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>) <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
533
|
+
<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">j</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>))
|
534
|
+
<span class="ruby-identifier">j</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>
|
535
|
+
<span class="ruby-keyword kw">end</span>
|
536
|
+
<span class="ruby-keyword kw">end</span>
|
537
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">nha</span>)
|
538
|
+
<span class="ruby-keyword kw">else</span>
|
539
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
540
|
+
<span class="ruby-keyword kw">end</span>
|
541
|
+
<span class="ruby-keyword kw">end</span>
|
542
|
+
</pre>
|
543
|
+
</div>
|
544
|
+
</div>
|
545
|
+
</div>
|
546
|
+
<div class="method">
|
547
|
+
<div class="title">
|
548
|
+
<a name="M000338"></a><b>concat</b>(ha)
|
549
|
+
</div>
|
550
|
+
<div class="sourcecode">
|
551
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000338_source')" id="l_M000338_source">+</a> ]</p>
|
552
|
+
<div id="M000338_source" class="dyn-source">
|
553
|
+
<pre>
|
554
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 204</span>
|
555
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">concat</span>(<span class="ruby-identifier">ha</span>)
|
556
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">ha</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>,<span class="ruby-identifier">ha</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) }
|
557
|
+
<span class="ruby-keyword kw">self</span>
|
558
|
+
<span class="ruby-keyword kw">end</span>
|
559
|
+
</pre>
|
560
|
+
</div>
|
561
|
+
</div>
|
562
|
+
</div>
|
563
|
+
<div class="method">
|
564
|
+
<div class="title">
|
565
|
+
<a name="M000339"></a><b>count</b>(e=nil) {|self.fetch(i)| ...}
|
566
|
+
</div>
|
567
|
+
<div class="sourcecode">
|
568
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000339_source')" id="l_M000339_source">+</a> ]</p>
|
569
|
+
<div id="M000339_source" class="dyn-source">
|
570
|
+
<pre>
|
571
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 209</span>
|
572
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count</span>(<span class="ruby-identifier">e</span>=<span class="ruby-keyword kw">nil</span>)
|
573
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
574
|
+
<span class="ruby-identifier">cnt</span> = <span class="ruby-value">0</span>
|
575
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cnt</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) }
|
576
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">cnt</span>
|
577
|
+
<span class="ruby-keyword kw">else</span>
|
578
|
+
<span class="ruby-identifier">cnt</span> = <span class="ruby-value">0</span>
|
579
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cnt</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>) <span class="ruby-operator">==</span> <span class="ruby-identifier">e</span> }
|
580
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">cnt</span>
|
581
|
+
<span class="ruby-keyword kw">end</span>
|
582
|
+
<span class="ruby-keyword kw">end</span>
|
583
|
+
</pre>
|
584
|
+
</div>
|
585
|
+
</div>
|
586
|
+
</div>
|
587
|
+
<div class="method">
|
588
|
+
<div class="title">
|
589
|
+
<a name="M000340"></a><b>delete</b>(e) {|if block_given?| ...}
|
590
|
+
</div>
|
591
|
+
<div class="sourcecode">
|
592
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000340_source')" id="l_M000340_source">+</a> ]</p>
|
593
|
+
<div id="M000340_source" class="dyn-source">
|
594
|
+
<pre>
|
595
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 224</span>
|
596
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">e</span>)
|
597
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">has_value?</span>(<span class="ruby-identifier">e</span>)
|
598
|
+
<span class="ruby-identifier">qdelete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">e</span> }
|
599
|
+
<span class="ruby-identifier">reindex!</span>
|
600
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">e</span>
|
601
|
+
<span class="ruby-keyword kw">else</span>
|
602
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
603
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
604
|
+
<span class="ruby-keyword kw">end</span>
|
605
|
+
<span class="ruby-keyword kw">end</span>
|
606
|
+
</pre>
|
607
|
+
</div>
|
608
|
+
</div>
|
609
|
+
</div>
|
610
|
+
<div class="method">
|
611
|
+
<div class="title">
|
612
|
+
<a name="M000341"></a><b>delete_at</b>(i)
|
613
|
+
</div>
|
614
|
+
<div class="sourcecode">
|
615
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000341_source')" id="l_M000341_source">+</a> ]</p>
|
616
|
+
<div id="M000341_source" class="dyn-source">
|
617
|
+
<pre>
|
618
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 235</span>
|
619
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">i</span>)
|
620
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">i</span>)
|
621
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)
|
622
|
+
<span class="ruby-identifier">qdelete</span>(<span class="ruby-identifier">i</span>)
|
623
|
+
<span class="ruby-identifier">reindex!</span>
|
624
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">e</span>
|
625
|
+
<span class="ruby-keyword kw">else</span>
|
626
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
627
|
+
<span class="ruby-keyword kw">end</span>
|
628
|
+
<span class="ruby-keyword kw">end</span>
|
629
|
+
</pre>
|
630
|
+
</div>
|
631
|
+
</div>
|
632
|
+
</div>
|
633
|
+
<div class="method">
|
634
|
+
<div class="title">
|
635
|
+
<a name="M000342"></a><b>delete_if</b>() {|v| ...}
|
636
|
+
</div>
|
637
|
+
<div class="sourcecode">
|
638
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000342_source')" id="l_M000342_source">+</a> ]</p>
|
639
|
+
<div id="M000342_source" class="dyn-source">
|
640
|
+
<pre>
|
641
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 249</span>
|
642
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_if</span>
|
643
|
+
<span class="ruby-identifier">qdelete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">v</span>) }
|
644
|
+
<span class="ruby-identifier">reindex!</span>
|
645
|
+
<span class="ruby-keyword kw">end</span>
|
646
|
+
</pre>
|
647
|
+
</div>
|
648
|
+
</div>
|
649
|
+
</div>
|
650
|
+
<div class="method">
|
651
|
+
<div class="title">
|
652
|
+
<a name="M000343"></a><b>each</b>() {|self.fetch(i)| ...}
|
653
|
+
</div>
|
654
|
+
<div class="sourcecode">
|
655
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000343_source')" id="l_M000343_source">+</a> ]</p>
|
656
|
+
<div id="M000343_source" class="dyn-source">
|
657
|
+
<pre>
|
658
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 254</span>
|
659
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>
|
660
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) }
|
661
|
+
<span class="ruby-keyword kw">end</span>
|
662
|
+
</pre>
|
663
|
+
</div>
|
664
|
+
</div>
|
665
|
+
</div>
|
666
|
+
<div class="method">
|
667
|
+
<div class="title">
|
668
|
+
<a name="M000344"></a><b>each_index</b>() {|i| ...}
|
669
|
+
</div>
|
670
|
+
<div class="sourcecode">
|
671
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000344_source')" id="l_M000344_source">+</a> ]</p>
|
672
|
+
<div id="M000344_source" class="dyn-source">
|
673
|
+
<pre>
|
674
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 258</span>
|
675
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_index</span>
|
676
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">i</span>) }
|
677
|
+
<span class="ruby-keyword kw">end</span>
|
678
|
+
</pre>
|
679
|
+
</div>
|
680
|
+
</div>
|
681
|
+
</div>
|
682
|
+
<div class="method">
|
683
|
+
<div class="title">
|
684
|
+
<a name="M000345"></a><b>eql?</b>(ha)
|
685
|
+
</div>
|
686
|
+
<div class="description">
|
687
|
+
<p>
|
688
|
+
empty? okay as is
|
689
|
+
</p>
|
690
|
+
</div>
|
691
|
+
<div class="sourcecode">
|
692
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000345_source')" id="l_M000345_source">+</a> ]</p>
|
693
|
+
<div id="M000345_source" class="dyn-source">
|
694
|
+
<pre>
|
695
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 264</span>
|
696
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eql?</span>(<span class="ruby-identifier">ha</span>)
|
697
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">ha</span>.<span class="ruby-identifier">length</span>
|
698
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">all?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>).<span class="ruby-identifier">eql?</span>(<span class="ruby-identifier">ha</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) }
|
699
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
700
|
+
<span class="ruby-keyword kw">end</span>
|
701
|
+
</pre>
|
702
|
+
</div>
|
703
|
+
</div>
|
704
|
+
</div>
|
705
|
+
<div class="method">
|
706
|
+
<div class="title">
|
707
|
+
<a name="M000346"></a><b>fill</b>(f,s=nil,l=nil)
|
708
|
+
</div>
|
709
|
+
<div class="sourcecode">
|
710
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000346_source')" id="l_M000346_source">+</a> ]</p>
|
711
|
+
<div id="M000346_source" class="dyn-source">
|
712
|
+
<pre>
|
713
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 270</span>
|
714
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fill</span>(<span class="ruby-identifier">f</span>,<span class="ruby-identifier">s</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">l</span>=<span class="ruby-keyword kw">nil</span>)
|
715
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Range</span>)
|
716
|
+
<span class="ruby-identifier">r</span> = <span class="ruby-identifier">s</span>
|
717
|
+
<span class="ruby-keyword kw">else</span>
|
718
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">s</span>
|
719
|
+
<span class="ruby-identifier">l</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">s</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">l</span>
|
720
|
+
<span class="ruby-identifier">r</span> = <span class="ruby-identifier">s</span><span class="ruby-operator">...</span>(<span class="ruby-identifier">s</span><span class="ruby-operator">+</span><span class="ruby-identifier">l</span>)
|
721
|
+
<span class="ruby-keyword kw">end</span>
|
722
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">i</span>,<span class="ruby-identifier">f</span>) }
|
723
|
+
<span class="ruby-keyword kw">self</span>
|
724
|
+
<span class="ruby-keyword kw">end</span>
|
725
|
+
</pre>
|
726
|
+
</div>
|
727
|
+
</div>
|
728
|
+
</div>
|
729
|
+
<div class="method">
|
730
|
+
<div class="title">
|
731
|
+
<a name="M000347"></a><b>first</b>()
|
732
|
+
</div>
|
733
|
+
<div class="sourcecode">
|
734
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000347_source')" id="l_M000347_source">+</a> ]</p>
|
735
|
+
<div id="M000347_source" class="dyn-source">
|
736
|
+
<pre>
|
737
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 282</span>
|
738
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">first</span>
|
739
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">empty?</span>
|
740
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">0</span>)
|
741
|
+
<span class="ruby-keyword kw">end</span>
|
742
|
+
</pre>
|
743
|
+
</div>
|
744
|
+
</div>
|
745
|
+
</div>
|
746
|
+
<div class="method">
|
747
|
+
<div class="title">
|
748
|
+
<a name="M000348"></a><b>flatten</b>()
|
749
|
+
</div>
|
750
|
+
<div class="sourcecode">
|
751
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000348_source')" id="l_M000348_source">+</a> ]</p>
|
752
|
+
<div id="M000348_source" class="dyn-source">
|
753
|
+
<pre>
|
754
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 287</span>
|
755
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flatten</span>
|
756
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
|
757
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</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>
|
758
|
+
<span class="ruby-identifier">sfi</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)
|
759
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sfi</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">sfi</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Array</span>)
|
760
|
+
<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">sfi</span>.<span class="ruby-identifier">flatten</span>)
|
761
|
+
<span class="ruby-keyword kw">else</span>
|
762
|
+
<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">length</span>,<span class="ruby-identifier">sfi</span>)
|
763
|
+
<span class="ruby-keyword kw">end</span>
|
764
|
+
<span class="ruby-keyword kw">end</span>
|
765
|
+
<span class="ruby-identifier">nha</span>
|
766
|
+
<span class="ruby-keyword kw">end</span>
|
767
|
+
</pre>
|
768
|
+
</div>
|
769
|
+
</div>
|
770
|
+
</div>
|
771
|
+
<div class="method">
|
772
|
+
<div class="title">
|
773
|
+
<a name="M000349"></a><b>flatten!</b>()
|
774
|
+
</div>
|
775
|
+
<div class="sourcecode">
|
776
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000349_source')" id="l_M000349_source">+</a> ]</p>
|
777
|
+
<div id="M000349_source" class="dyn-source">
|
778
|
+
<pre>
|
779
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 300</span>
|
780
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flatten!</span>
|
781
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Array</span>) }
|
782
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">replace</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">flatten</span>)
|
783
|
+
<span class="ruby-keyword kw">end</span>
|
784
|
+
</pre>
|
785
|
+
</div>
|
786
|
+
</div>
|
787
|
+
</div>
|
788
|
+
<div class="method">
|
789
|
+
<div class="title">
|
790
|
+
<a name="M000350"></a><b>include?</b>(v)
|
791
|
+
</div>
|
792
|
+
<div class="sourcecode">
|
793
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000350_source')" id="l_M000350_source">+</a> ]</p>
|
794
|
+
<div id="M000350_source" class="dyn-source">
|
795
|
+
<pre>
|
796
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 305</span>
|
797
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">v</span>)
|
798
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-identifier">v</span>)
|
799
|
+
<span class="ruby-keyword kw">end</span>
|
800
|
+
</pre>
|
801
|
+
</div>
|
802
|
+
</div>
|
803
|
+
</div>
|
804
|
+
<div class="method">
|
805
|
+
<div class="title">
|
806
|
+
<a name="M000351"></a><b>join</b>(sep='')
|
807
|
+
</div>
|
808
|
+
<div class="description">
|
809
|
+
<p>
|
810
|
+
index okay
|
811
|
+
</p>
|
812
|
+
</div>
|
813
|
+
<div class="sourcecode">
|
814
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000351_source')" id="l_M000351_source">+</a> ]</p>
|
815
|
+
<div id="M000351_source" class="dyn-source">
|
816
|
+
<pre>
|
817
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 311</span>
|
818
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">join</span>(<span class="ruby-identifier">sep</span>=<span class="ruby-value str">''</span>)
|
819
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-value str">''</span>
|
820
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{self.fetch(i)}#{sep}"</span> }
|
821
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">chomp</span>(<span class="ruby-identifier">sep</span>)
|
822
|
+
<span class="ruby-keyword kw">end</span>
|
823
|
+
</pre>
|
824
|
+
</div>
|
825
|
+
</div>
|
826
|
+
</div>
|
827
|
+
<div class="method">
|
828
|
+
<div class="title">
|
829
|
+
<a name="M000352"></a><b>last</b>()
|
830
|
+
</div>
|
831
|
+
<div class="sourcecode">
|
832
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000352_source')" id="l_M000352_source">+</a> ]</p>
|
833
|
+
<div id="M000352_source" class="dyn-source">
|
834
|
+
<pre>
|
835
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 317</span>
|
836
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last</span>
|
837
|
+
<span class="ruby-keyword kw">self</span>[<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>]
|
838
|
+
<span class="ruby-keyword kw">end</span>
|
839
|
+
</pre>
|
840
|
+
</div>
|
841
|
+
</div>
|
842
|
+
</div>
|
843
|
+
<div class="method">
|
844
|
+
<div class="title">
|
845
|
+
<a name="M000353"></a><b>map!</b>()
|
846
|
+
</div>
|
847
|
+
<div class="description">
|
848
|
+
<p>
|
849
|
+
Alias for <a href="SparseArray.html#M000334">collect</a>!
|
850
|
+
</p>
|
851
|
+
</div>
|
852
|
+
</div>
|
853
|
+
<div class="method">
|
854
|
+
<div class="title">
|
855
|
+
<a name="M000354"></a><b>nitems</b>()
|
856
|
+
</div>
|
857
|
+
<div class="sourcecode">
|
858
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000354_source')" id="l_M000354_source">+</a> ]</p>
|
859
|
+
<div id="M000354_source" class="dyn-source">
|
860
|
+
<pre>
|
861
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 325</span>
|
862
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nitems</span>
|
863
|
+
<span class="ruby-identifier">cnt</span> = <span class="ruby-value">0</span>
|
864
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cnt</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>) <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> }
|
865
|
+
<span class="ruby-identifier">cnt</span>
|
866
|
+
<span class="ruby-keyword kw">end</span>
|
867
|
+
</pre>
|
868
|
+
</div>
|
869
|
+
</div>
|
870
|
+
</div>
|
871
|
+
<div class="method">
|
872
|
+
<div class="title">
|
873
|
+
<a name="M000355"></a><b>pack</b>(*args)
|
874
|
+
</div>
|
875
|
+
<div class="sourcecode">
|
876
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000355_source')" id="l_M000355_source">+</a> ]</p>
|
877
|
+
<div id="M000355_source" class="dyn-source">
|
878
|
+
<pre>
|
879
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 331</span>
|
880
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pack</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
881
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">pack</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
882
|
+
<span class="ruby-keyword kw">end</span>
|
883
|
+
</pre>
|
884
|
+
</div>
|
885
|
+
</div>
|
886
|
+
</div>
|
887
|
+
<div class="method">
|
888
|
+
<div class="title">
|
889
|
+
<a name="M000356"></a><b>pop</b>()
|
890
|
+
</div>
|
891
|
+
<div class="sourcecode">
|
892
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000356_source')" id="l_M000356_source">+</a> ]</p>
|
893
|
+
<div id="M000356_source" class="dyn-source">
|
894
|
+
<pre>
|
895
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 335</span>
|
896
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pop</span>
|
897
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)
|
898
|
+
<span class="ruby-keyword kw">end</span>
|
899
|
+
</pre>
|
900
|
+
</div>
|
901
|
+
</div>
|
902
|
+
</div>
|
903
|
+
<div class="method">
|
904
|
+
<div class="title">
|
905
|
+
<a name="M000357"></a><b>push</b>(*e)
|
906
|
+
</div>
|
907
|
+
<div class="sourcecode">
|
908
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000357_source')" id="l_M000357_source">+</a> ]</p>
|
909
|
+
<div id="M000357_source" class="dyn-source">
|
910
|
+
<pre>
|
911
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 339</span>
|
912
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">push</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">e</span>)
|
913
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">e</span>)
|
914
|
+
<span class="ruby-keyword kw">end</span>
|
915
|
+
</pre>
|
916
|
+
</div>
|
917
|
+
</div>
|
918
|
+
</div>
|
919
|
+
<div class="method">
|
920
|
+
<div class="title">
|
921
|
+
<a name="M000370"></a><b>qsort</b>(ha, l, r)
|
922
|
+
</div>
|
923
|
+
<div class="sourcecode">
|
924
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000370_source')" id="l_M000370_source">+</a> ]</p>
|
925
|
+
<div id="M000370_source" class="dyn-source">
|
926
|
+
<pre>
|
927
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 438</span>
|
928
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">qsort</span>(<span class="ruby-identifier">ha</span>, <span class="ruby-identifier">l</span>, <span class="ruby-identifier">r</span>)
|
929
|
+
<span class="ruby-identifier">l_hold</span> = <span class="ruby-identifier">l</span>
|
930
|
+
<span class="ruby-identifier">r_hold</span> = <span class="ruby-identifier">r</span>
|
931
|
+
<span class="ruby-identifier">pivot</span> = <span class="ruby-identifier">ha</span>[<span class="ruby-identifier">l</span>]
|
932
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">l</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">r</span>
|
933
|
+
<span class="ruby-identifier">r</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">ha</span>[<span class="ruby-identifier">r</span>] <span class="ruby-operator"><=></span> <span class="ruby-identifier">pivot</span>) <span class="ruby-operator">>=</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">l</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">r</span>
|
934
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">l</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">r</span>
|
935
|
+
<span class="ruby-identifier">ha</span>[<span class="ruby-identifier">l</span>] = <span class="ruby-identifier">ha</span>[<span class="ruby-identifier">r</span>]
|
936
|
+
<span class="ruby-identifier">l</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
937
|
+
<span class="ruby-keyword kw">end</span>
|
938
|
+
<span class="ruby-identifier">l</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">ha</span>[<span class="ruby-identifier">l</span>] <span class="ruby-operator"><=></span> <span class="ruby-identifier">pivot</span>) <span class="ruby-operator"><=</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">l</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">r</span>
|
939
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">l</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">r</span>
|
940
|
+
<span class="ruby-identifier">ha</span>[<span class="ruby-identifier">r</span>] = <span class="ruby-identifier">ha</span>[<span class="ruby-identifier">l</span>]
|
941
|
+
<span class="ruby-identifier">r</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
942
|
+
<span class="ruby-keyword kw">end</span>
|
943
|
+
<span class="ruby-keyword kw">end</span>
|
944
|
+
<span class="ruby-identifier">ha</span>[<span class="ruby-identifier">l</span>] = <span class="ruby-identifier">pivot</span>
|
945
|
+
<span class="ruby-identifier">pivot</span> = <span class="ruby-identifier">l</span>
|
946
|
+
<span class="ruby-identifier">l</span> = <span class="ruby-identifier">l_hold</span>
|
947
|
+
<span class="ruby-identifier">r</span> = <span class="ruby-identifier">r_hold</span>
|
948
|
+
<span class="ruby-identifier">qsort</span>(<span class="ruby-identifier">ha</span>,<span class="ruby-identifier">l</span>,<span class="ruby-identifier">pivot</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">l</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">pivot</span>
|
949
|
+
<span class="ruby-identifier">qsort</span>(<span class="ruby-identifier">ha</span>,<span class="ruby-identifier">pivot</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>,<span class="ruby-identifier">r</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span> <span class="ruby-operator">></span> <span class="ruby-identifier">pivot</span>
|
950
|
+
<span class="ruby-identifier">ha</span>
|
951
|
+
<span class="ruby-keyword kw">end</span>
|
952
|
+
</pre>
|
953
|
+
</div>
|
954
|
+
</div>
|
955
|
+
</div>
|
956
|
+
<div class="method">
|
957
|
+
<div class="title">
|
958
|
+
<a name="M000358"></a><b>rassoc</b>(k)
|
959
|
+
</div>
|
960
|
+
<div class="sourcecode">
|
961
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000358_source')" id="l_M000358_source">+</a> ]</p>
|
962
|
+
<div id="M000358_source" class="dyn-source">
|
963
|
+
<pre>
|
964
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 343</span>
|
965
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rassoc</span>(<span class="ruby-identifier">k</span>)
|
966
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">k</span> }
|
967
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
968
|
+
<span class="ruby-keyword kw">end</span>
|
969
|
+
</pre>
|
970
|
+
</div>
|
971
|
+
</div>
|
972
|
+
</div>
|
973
|
+
<div class="method">
|
974
|
+
<div class="title">
|
975
|
+
<a name="M000359"></a><b>reindex</b>()
|
976
|
+
</div>
|
977
|
+
<div class="sourcecode">
|
978
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000359_source')" id="l_M000359_source">+</a> ]</p>
|
979
|
+
<div id="M000359_source" class="dyn-source">
|
980
|
+
<pre>
|
981
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 348</span>
|
982
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reindex</span>
|
983
|
+
<span class="ruby-identifier">nha</span>, <span class="ruby-identifier">j</span>, <span class="ruby-identifier">k</span>, <span class="ruby-identifier">tl</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>
|
984
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">k</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">tl</span>
|
985
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">j</span>)
|
986
|
+
<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">k</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">j</span>))
|
987
|
+
<span class="ruby-identifier">j</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>; <span class="ruby-identifier">k</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>
|
988
|
+
<span class="ruby-keyword kw">else</span>
|
989
|
+
<span class="ruby-identifier">j</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>
|
990
|
+
<span class="ruby-keyword kw">end</span>
|
991
|
+
<span class="ruby-keyword kw">end</span>
|
992
|
+
<span class="ruby-identifier">nha</span>
|
993
|
+
<span class="ruby-keyword kw">end</span>
|
994
|
+
</pre>
|
995
|
+
</div>
|
996
|
+
</div>
|
997
|
+
</div>
|
998
|
+
<div class="method">
|
999
|
+
<div class="title">
|
1000
|
+
<a name="M000360"></a><b>reindex!</b>()
|
1001
|
+
</div>
|
1002
|
+
<div class="sourcecode">
|
1003
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000360_source')" id="l_M000360_source">+</a> ]</p>
|
1004
|
+
<div id="M000360_source" class="dyn-source">
|
1005
|
+
<pre>
|
1006
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 361</span>
|
1007
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reindex!</span>
|
1008
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">replace</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">reindex</span>)
|
1009
|
+
<span class="ruby-keyword kw">end</span>
|
1010
|
+
</pre>
|
1011
|
+
</div>
|
1012
|
+
</div>
|
1013
|
+
</div>
|
1014
|
+
<div class="method">
|
1015
|
+
<div class="title">
|
1016
|
+
<a name="M000361"></a><b>reject!</b>() {|v| ...}
|
1017
|
+
</div>
|
1018
|
+
<div class="sourcecode">
|
1019
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000361_source')" id="l_M000361_source">+</a> ]</p>
|
1020
|
+
<div id="M000361_source" class="dyn-source">
|
1021
|
+
<pre>
|
1022
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 365</span>
|
1023
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reject!</span>
|
1024
|
+
<span class="ruby-identifier">chg</span>=<span class="ruby-keyword kw">nil</span>
|
1025
|
+
<span class="ruby-identifier">qdelete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">r</span>=<span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">v</span>); <span class="ruby-identifier">chg</span>=<span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span>; <span class="ruby-identifier">r</span> }
|
1026
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">chg</span>
|
1027
|
+
<span class="ruby-identifier">reindex!</span>
|
1028
|
+
<span class="ruby-keyword kw">end</span>
|
1029
|
+
</pre>
|
1030
|
+
</div>
|
1031
|
+
</div>
|
1032
|
+
</div>
|
1033
|
+
<div class="method">
|
1034
|
+
<div class="title">
|
1035
|
+
<a name="M000362"></a><b>reverse</b>()
|
1036
|
+
</div>
|
1037
|
+
<div class="description">
|
1038
|
+
<p>
|
1039
|
+
def replace(ha)
|
1040
|
+
</p>
|
1041
|
+
<pre>
|
1042
|
+
if ha.length < self.length
|
1043
|
+
(ha.length..self.length-1).each { |i| self.delete(i) }
|
1044
|
+
(0..ha.length-1).each { |i| self.set(i,ha[i]) }
|
1045
|
+
end
|
1046
|
+
</pre>
|
1047
|
+
<p>
|
1048
|
+
end
|
1049
|
+
</p>
|
1050
|
+
</div>
|
1051
|
+
<div class="sourcecode">
|
1052
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000362_source')" id="l_M000362_source">+</a> ]</p>
|
1053
|
+
<div id="M000362_source" class="dyn-source">
|
1054
|
+
<pre>
|
1055
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 379</span>
|
1056
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reverse</span>
|
1057
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
|
1058
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">nha</span>.<span class="ruby-identifier">set</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">i</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) }
|
1059
|
+
<span class="ruby-identifier">nha</span>
|
1060
|
+
<span class="ruby-keyword kw">end</span>
|
1061
|
+
</pre>
|
1062
|
+
</div>
|
1063
|
+
</div>
|
1064
|
+
</div>
|
1065
|
+
<div class="method">
|
1066
|
+
<div class="title">
|
1067
|
+
<a name="M000363"></a><b>reverse!</b>()
|
1068
|
+
</div>
|
1069
|
+
<div class="sourcecode">
|
1070
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000363_source')" id="l_M000363_source">+</a> ]</p>
|
1071
|
+
<div id="M000363_source" class="dyn-source">
|
1072
|
+
<pre>
|
1073
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 385</span>
|
1074
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reverse!</span>
|
1075
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">/</span><span class="ruby-value">2</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>
|
1076
|
+
<span class="ruby-identifier">ri</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">i</span>
|
1077
|
+
<span class="ruby-identifier">tmp</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">ri</span>)
|
1078
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">ri</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>))
|
1079
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">i</span>,<span class="ruby-identifier">tmp</span>)
|
1080
|
+
<span class="ruby-keyword kw">end</span>
|
1081
|
+
<span class="ruby-keyword kw">self</span>
|
1082
|
+
<span class="ruby-keyword kw">end</span>
|
1083
|
+
</pre>
|
1084
|
+
</div>
|
1085
|
+
</div>
|
1086
|
+
</div>
|
1087
|
+
<div class="method">
|
1088
|
+
<div class="title">
|
1089
|
+
<a name="M000364"></a><b>reverse_each</b>() {|self.fetch(i)| ...}
|
1090
|
+
</div>
|
1091
|
+
<div class="sourcecode">
|
1092
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000364_source')" id="l_M000364_source">+</a> ]</p>
|
1093
|
+
<div id="M000364_source" class="dyn-source">
|
1094
|
+
<pre>
|
1095
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 395</span>
|
1096
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reverse_each</span>
|
1097
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
1098
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">>=</span> <span class="ruby-value">0</span>
|
1099
|
+
<span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>))
|
1100
|
+
<span class="ruby-identifier">i</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
1101
|
+
<span class="ruby-keyword kw">end</span>
|
1102
|
+
<span class="ruby-keyword kw">end</span>
|
1103
|
+
</pre>
|
1104
|
+
</div>
|
1105
|
+
</div>
|
1106
|
+
</div>
|
1107
|
+
<div class="method">
|
1108
|
+
<div class="title">
|
1109
|
+
<a name="M000365"></a><b>rindex</b>(e)
|
1110
|
+
</div>
|
1111
|
+
<div class="sourcecode">
|
1112
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000365_source')" id="l_M000365_source">+</a> ]</p>
|
1113
|
+
<div id="M000365_source" class="dyn-source">
|
1114
|
+
<pre>
|
1115
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 403</span>
|
1116
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rindex</span>(<span class="ruby-identifier">e</span>)
|
1117
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
1118
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">>=</span> <span class="ruby-value">0</span>
|
1119
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>) <span class="ruby-operator">==</span> <span class="ruby-identifier">e</span>
|
1120
|
+
<span class="ruby-identifier">i</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
1121
|
+
<span class="ruby-keyword kw">end</span>
|
1122
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
1123
|
+
<span class="ruby-keyword kw">end</span>
|
1124
|
+
</pre>
|
1125
|
+
</div>
|
1126
|
+
</div>
|
1127
|
+
</div>
|
1128
|
+
<div class="method">
|
1129
|
+
<div class="title">
|
1130
|
+
<a name="M000366"></a><b>shift</b>()
|
1131
|
+
</div>
|
1132
|
+
<div class="sourcecode">
|
1133
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000366_source')" id="l_M000366_source">+</a> ]</p>
|
1134
|
+
<div id="M000366_source" class="dyn-source">
|
1135
|
+
<pre>
|
1136
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 412</span>
|
1137
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shift</span>
|
1138
|
+
<span class="ruby-identifier">e1</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-value">0</span>]
|
1139
|
+
<span class="ruby-identifier">tl</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
1140
|
+
(<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-identifier">tl</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">i</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>)) }
|
1141
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">tl</span>)
|
1142
|
+
<span class="ruby-identifier">e1</span>
|
1143
|
+
<span class="ruby-keyword kw">end</span>
|
1144
|
+
</pre>
|
1145
|
+
</div>
|
1146
|
+
</div>
|
1147
|
+
</div>
|
1148
|
+
<div class="method">
|
1149
|
+
<div class="title">
|
1150
|
+
<a name="M000367"></a><b>slice</b>(*args)
|
1151
|
+
</div>
|
1152
|
+
<div class="description">
|
1153
|
+
<p>
|
1154
|
+
size okay
|
1155
|
+
</p>
|
1156
|
+
</div>
|
1157
|
+
<div class="sourcecode">
|
1158
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000367_source')" id="l_M000367_source">+</a> ]</p>
|
1159
|
+
<div id="M000367_source" class="dyn-source">
|
1160
|
+
<pre>
|
1161
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 422</span>
|
1162
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">slice</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
1163
|
+
<span class="ruby-keyword kw">self</span>[<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>]
|
1164
|
+
<span class="ruby-keyword kw">end</span>
|
1165
|
+
</pre>
|
1166
|
+
</div>
|
1167
|
+
</div>
|
1168
|
+
</div>
|
1169
|
+
<div class="method">
|
1170
|
+
<div class="title">
|
1171
|
+
<a name="M000368"></a><b>slice!</b>(*args)
|
1172
|
+
</div>
|
1173
|
+
<div class="sourcecode">
|
1174
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000368_source')" id="l_M000368_source">+</a> ]</p>
|
1175
|
+
<div id="M000368_source" class="dyn-source">
|
1176
|
+
<pre>
|
1177
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 426</span>
|
1178
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">slice!</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
1179
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>]
|
1180
|
+
<span class="ruby-keyword kw">self</span>[<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>] = <span class="ruby-keyword kw">nil</span>
|
1181
|
+
<span class="ruby-identifier">result</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="M000369"></a><b>sort</b>()
|
1190
|
+
</div>
|
1191
|
+
<div class="sourcecode">
|
1192
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000369_source')" id="l_M000369_source">+</a> ]</p>
|
1193
|
+
<div id="M000369_source" class="dyn-source">
|
1194
|
+
<pre>
|
1195
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 432</span>
|
1196
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sort</span>
|
1197
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"SparseArray does not currently support sorting with blocks"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
1198
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
|
1199
|
+
<span class="ruby-identifier">qsort</span>(<span class="ruby-identifier">nha</span>,<span class="ruby-value">0</span>,<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)
|
1200
|
+
<span class="ruby-keyword kw">end</span>
|
1201
|
+
</pre>
|
1202
|
+
</div>
|
1203
|
+
</div>
|
1204
|
+
</div>
|
1205
|
+
<div class="method">
|
1206
|
+
<div class="title">
|
1207
|
+
<a name="M000371"></a><b>sort!</b>()
|
1208
|
+
</div>
|
1209
|
+
<div class="sourcecode">
|
1210
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000371_source')" id="l_M000371_source">+</a> ]</p>
|
1211
|
+
<div id="M000371_source" class="dyn-source">
|
1212
|
+
<pre>
|
1213
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 463</span>
|
1214
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sort!</span>
|
1215
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"SparseArray does not currently support sorting with blocks"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
1216
|
+
<span class="ruby-identifier">qsort</span>(<span class="ruby-keyword kw">self</span>,<span class="ruby-value">0</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)
|
1217
|
+
<span class="ruby-keyword kw">end</span>
|
1218
|
+
</pre>
|
1219
|
+
</div>
|
1220
|
+
</div>
|
1221
|
+
</div>
|
1222
|
+
<div class="method">
|
1223
|
+
<div class="title">
|
1224
|
+
<a name="M000372"></a><b>to_a</b>()
|
1225
|
+
</div>
|
1226
|
+
<div class="sourcecode">
|
1227
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000372_source')" id="l_M000372_source">+</a> ]</p>
|
1228
|
+
<div id="M000372_source" class="dyn-source">
|
1229
|
+
<pre>
|
1230
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 468</span>
|
1231
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_a</span>
|
1232
|
+
<span class="ruby-identifier">a</span> = []
|
1233
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>) }
|
1234
|
+
<span class="ruby-identifier">a</span>
|
1235
|
+
<span class="ruby-keyword kw">end</span>
|
1236
|
+
</pre>
|
1237
|
+
</div>
|
1238
|
+
</div>
|
1239
|
+
</div>
|
1240
|
+
<div class="method">
|
1241
|
+
<div class="title">
|
1242
|
+
<a name="M000373"></a><b>to_ary</b>()
|
1243
|
+
</div>
|
1244
|
+
<div class="sourcecode">
|
1245
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000373_source')" id="l_M000373_source">+</a> ]</p>
|
1246
|
+
<div id="M000373_source" class="dyn-source">
|
1247
|
+
<pre>
|
1248
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 474</span>
|
1249
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ary</span>
|
1250
|
+
<span class="ruby-keyword kw">self</span>
|
1251
|
+
<span class="ruby-keyword kw">end</span>
|
1252
|
+
</pre>
|
1253
|
+
</div>
|
1254
|
+
</div>
|
1255
|
+
</div>
|
1256
|
+
<div class="method">
|
1257
|
+
<div class="title">
|
1258
|
+
<a name="M000374"></a><b>to_h</b>()
|
1259
|
+
</div>
|
1260
|
+
<div class="sourcecode">
|
1261
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000374_source')" id="l_M000374_source">+</a> ]</p>
|
1262
|
+
<div id="M000374_source" class="dyn-source">
|
1263
|
+
<pre>
|
1264
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 478</span>
|
1265
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h</span>
|
1266
|
+
<span class="ruby-identifier">h</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
1267
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span> }
|
1268
|
+
<span class="ruby-identifier">h</span>
|
1269
|
+
<span class="ruby-keyword kw">end</span>
|
1270
|
+
</pre>
|
1271
|
+
</div>
|
1272
|
+
</div>
|
1273
|
+
</div>
|
1274
|
+
<div class="method">
|
1275
|
+
<div class="title">
|
1276
|
+
<a name="M000375"></a><b>to_s</b>()
|
1277
|
+
</div>
|
1278
|
+
<div class="sourcecode">
|
1279
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000375_source')" id="l_M000375_source">+</a> ]</p>
|
1280
|
+
<div id="M000375_source" class="dyn-source">
|
1281
|
+
<pre>
|
1282
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 484</span>
|
1283
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
1284
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">join</span>
|
1285
|
+
<span class="ruby-keyword kw">end</span>
|
1286
|
+
</pre>
|
1287
|
+
</div>
|
1288
|
+
</div>
|
1289
|
+
</div>
|
1290
|
+
<div class="method">
|
1291
|
+
<div class="title">
|
1292
|
+
<a name="M000376"></a><b>uniq</b>()
|
1293
|
+
</div>
|
1294
|
+
<div class="sourcecode">
|
1295
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000376_source')" id="l_M000376_source">+</a> ]</p>
|
1296
|
+
<div id="M000376_source" class="dyn-source">
|
1297
|
+
<pre>
|
1298
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 488</span>
|
1299
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">uniq</span>
|
1300
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
|
1301
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</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>
|
1302
|
+
<span class="ruby-identifier">nha</span>[<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">length</span>] = <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">i</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">nha</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">i</span>])
|
1303
|
+
<span class="ruby-keyword kw">end</span>
|
1304
|
+
<span class="ruby-identifier">nha</span>
|
1305
|
+
<span class="ruby-keyword kw">end</span>
|
1306
|
+
</pre>
|
1307
|
+
</div>
|
1308
|
+
</div>
|
1309
|
+
</div>
|
1310
|
+
<div class="method">
|
1311
|
+
<div class="title">
|
1312
|
+
<a name="M000377"></a><b>uniq!</b>()
|
1313
|
+
</div>
|
1314
|
+
<div class="sourcecode">
|
1315
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000377_source')" id="l_M000377_source">+</a> ]</p>
|
1316
|
+
<div id="M000377_source" class="dyn-source">
|
1317
|
+
<pre>
|
1318
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 496</span>
|
1319
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">uniq!</span>
|
1320
|
+
<span class="ruby-identifier">j</span> = <span class="ruby-value">0</span>
|
1321
|
+
(<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</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>
|
1322
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">self</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">j</span>].<span class="ruby-identifier">has_value?</span>(<span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">i</span>])
|
1323
|
+
<span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">j</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>] = <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">i</span>]
|
1324
|
+
<span class="ruby-identifier">j</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>
|
1325
|
+
<span class="ruby-keyword kw">end</span>
|
1326
|
+
<span class="ruby-keyword kw">end</span>
|
1327
|
+
(<span class="ruby-identifier">j</span><span class="ruby-operator">+</span><span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">qdelete</span>(<span class="ruby-identifier">i</span>) }
|
1328
|
+
<span class="ruby-keyword kw">end</span>
|
1329
|
+
</pre>
|
1330
|
+
</div>
|
1331
|
+
</div>
|
1332
|
+
</div>
|
1333
|
+
<div class="method">
|
1334
|
+
<div class="title">
|
1335
|
+
<a name="M000378"></a><b>unshift</b>(e)
|
1336
|
+
</div>
|
1337
|
+
<div class="sourcecode">
|
1338
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000378_source')" id="l_M000378_source">+</a> ]</p>
|
1339
|
+
<div id="M000378_source" class="dyn-source">
|
1340
|
+
<pre>
|
1341
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 507</span>
|
1342
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unshift</span>(<span class="ruby-identifier">e</span>)
|
1343
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
1344
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">>=</span> <span class="ruby-value">0</span>
|
1345
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>,<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>))
|
1346
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">i</span>) <span class="ruby-operator">==</span> <span class="ruby-identifier">e</span>
|
1347
|
+
<span class="ruby-identifier">i</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
1348
|
+
<span class="ruby-keyword kw">end</span>
|
1349
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-value">0</span>,<span class="ruby-identifier">e</span>)
|
1350
|
+
<span class="ruby-keyword kw">self</span>
|
1351
|
+
<span class="ruby-keyword kw">end</span>
|
1352
|
+
</pre>
|
1353
|
+
</div>
|
1354
|
+
</div>
|
1355
|
+
</div>
|
1356
|
+
<div class="method">
|
1357
|
+
<div class="title">
|
1358
|
+
<a name="M000379"></a><b>values_at</b>(*ix)
|
1359
|
+
</div>
|
1360
|
+
<div class="sourcecode">
|
1361
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000379_source')" id="l_M000379_source">+</a> ]</p>
|
1362
|
+
<div id="M000379_source" class="dyn-source">
|
1363
|
+
<pre>
|
1364
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 518</span>
|
1365
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">values_at</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">ix</span>)
|
1366
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
|
1367
|
+
<span class="ruby-identifier">ix</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">nha</span>[<span class="ruby-identifier">nha</span>.<span class="ruby-identifier">length</span>] = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">at</span>(<span class="ruby-identifier">i</span>)}
|
1368
|
+
<span class="ruby-identifier">nha</span>
|
1369
|
+
<span class="ruby-keyword kw">end</span>
|
1370
|
+
</pre>
|
1371
|
+
</div>
|
1372
|
+
</div>
|
1373
|
+
</div>
|
1374
|
+
<div class="method">
|
1375
|
+
<div class="title">
|
1376
|
+
<a name="M000331"></a><b>|</b>(ha)
|
1377
|
+
</div>
|
1378
|
+
<div class="sourcecode">
|
1379
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000331_source')" id="l_M000331_source">+</a> ]</p>
|
1380
|
+
<div id="M000331_source" class="dyn-source">
|
1381
|
+
<pre>
|
1382
|
+
<span class="ruby-comment cmt"># File lib/more/facets/sparse_array.rb, line 146</span>
|
1383
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">|</span>(<span class="ruby-identifier">ha</span>)
|
1384
|
+
<span class="ruby-identifier">nha</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
|
1385
|
+
<span class="ruby-identifier">ha</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">nha</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">v</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">nha</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-identifier">v</span>) }
|
1386
|
+
<span class="ruby-identifier">nha</span>
|
1387
|
+
<span class="ruby-keyword kw">end</span>
|
1388
|
+
</pre>
|
1389
|
+
</div>
|
1390
|
+
</div>
|
1391
|
+
</div>
|
1392
|
+
</div>
|
1393
|
+
|
1394
|
+
</div>
|
1395
|
+
|
1396
|
+
</body>
|
1397
|
+
</html>
|