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

Version Path
facets-0.9.0 lib/nano/hash/slice.rb
facets-1.0.0 lib/facet/hash/slice.rb
facets-1.0.3 packages/core/lib/facet/hash/slice.rb
facets-1.2.0 lib/facets/core/hash/slice.rb
facets-1.1.0 lib/facet/hash/slice.rb
facets-1.3.0 lib/facets/core/hash/slice.rb
facets-1.2.1 lib/facets/core/hash/slice.rb
facets-1.3.1 lib/facets/core/hash/slice.rb
facets-1.3.3 lib/facets/core/hash/slice.rb
facets-1.3.2 lib/facets/core/hash/slice.rb
facets-1.4.1 lib/facets/core/hash/slice.rb
facets-1.4.0 lib/facets/core/hash/slice.rb
facets-1.4.2 lib/facets/core/hash/slice.rb
facets-1.4.3 lib/facets/core/hash/slice.rb
facets-1.4.4 lib/facets/core/hash/slice.rb
facets-1.4.5 lib/facets/core/hash/slice.rb
facets-1.7.30 lib/facets/core/hash/slice.rb
facets-1.7.0 lib/facets/core/hash/slice.rb
facets-1.7.38 lib/facets/core/hash/slice.rb
facets-1.7.46 lib/facets/core/hash/slice.rb