Sha256: 07ecb915726ee565385f0812358fc87ba01d5de30f89bd55cd36757890a3899c
Contents?: true
Size: 586 Bytes
Versions: 3
Compression:
Stored size: 586 Bytes
Contents
require 'facets/array/splice' require 'facets/stackable' class Array include Stackable # "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.poke(9) #=> [9,1,2,3] # a #=> [9,1,2,3] # # CREDIT: Trans alias_method :poke, :unshift # Alias for shift which removes an object # off first slot of an array. This is # the contrary of pop. # # a=[1,2,3] # a.pull #=> 1 # a #=> [2,3] # # CREDIT: Trans alias_method :pull, :shift end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
facets-2.2.0 | lib/core/facets/array/stackable.rb |
facets-2.2.1 | lib/core/facets/array/stackable.rb |
facets-2.3.0 | lib/core/facets/array/stackable.rb |