Sha256: 6a3b6e494b9878edd26a9a11f900b9ed869186dd1823b6ea9550ffeab858f338

Contents?: true

Size: 587 Bytes

Versions: 19

Compression:

Stored size: 587 Bytes

Contents

class Array

  # "Put On Top". This is an alias for unshift
  # which puts an object# on top of the stack.
  # It is the converse of push.
  #
  #   a=[1,2,3]
  #   a.pot(9)   #=> [9,1,2,3]
  #   a          #=> [9,1,2,3]
  #
  alias_method( :pot, :unshift )

end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCArray < Test::Unit::TestCase

    def test_slap
      a = [2,3]
      assert_equal( [1,2,3], a.pot(1) )
      assert_equal( [4,1,2,3], a.pot(4) )
    end

  end

=end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
facets-1.3.1 lib/facets/core/array/pot.rb
facets-1.3.2 lib/facets/core/array/pot.rb
facets-1.3.3 lib/facets/core/array/pot.rb
facets-1.4.0 lib/facets/core/array/pot.rb
facets-1.4.2 lib/facets/core/array/pot.rb
facets-1.4.1 lib/facets/core/array/pot.rb
facets-1.4.3 lib/facets/core/array/pot.rb
facets-1.4.5 lib/facets/core/array/pot.rb
facets-1.4.4 lib/facets/core/array/pot.rb
facets-1.7.0 lib/facets/core/array/pot.rb
facets-1.7.38 lib/facets/core/array/pot.rb
facets-1.7.30 lib/facets/core/array/pot.rb
facets-1.7.46 lib/facets/core/array/pot.rb
facets-1.8.0 lib/facets/core/array/pot.rb
facets-1.8.20 lib/facets/core/array/pot.rb
facets-1.8.49 lib/facets/core/array/pot.rb
facets-1.8.51 lib/facets/core/array/pot.rb
facets-1.8.54 lib/facets/core/array/pot.rb
facets-1.8.8 lib/facets/core/array/pot.rb