Sha256: cc20d51dd597c530a8d01e451efe58163b0695e24fad1a883391bd4d39672547
Contents?: true
Size: 500 Bytes
Versions: 26
Compression:
Stored size: 500 Bytes
Contents
class Hash # Alias #slice to #values_at. # # h = { :a => 1, :b => 2, :c => 3 } # h.slice(:a) #=> [1] # h.slice(:a, :b) #=> [1,2] # alias_method( :slice, :values_at ) end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCHash < Test::Unit::TestCase def test_slice h = {:a=>1, :b=>2, :c=>3 } assert_equal( [1,2], h.slice(:a,:b) ) end end =end
Version data entries
26 entries across 26 versions & 1 rubygems