Sha256: 7739fa2f50509e4b5aaff93050591bf8f280f9b01f1555f6386df6b5c56796e8

Contents?: true

Size: 263 Bytes

Versions: 3

Compression:

Stored size: 263 Bytes

Contents

class Array
  # Alias for shift, which removes and returns
  # the first element in an array.
  #
  #   require 'facet/array/first'
  #
  #   a = ["a","y","z"]
  #   a.first!      #=> "a"
  #   p a           #=> ["y","z"]
  #
  alias_method( :first!, :shift)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-0.7.0 lib/facet/array/first%21.rb
facets-0.7.1 lib/facet/array/first%21.rb
facets-0.7.2 lib/facet/array/first%21.rb