Method: Array#poke
- Defined in:
- lib/core/facets/array/pull.rb
#poke(x, i = 0) ⇒ Object
Put an object on the bottom of the stack (front of the array).
a = [2, 3]
a.poke(1)
a #=> [1, 2, 3]
Or supply an index and #poke works like #insert.
26 27 28 |
# File 'lib/core/facets/array/pull.rb', line 26 def poke(x, i=0) insert(i,x) end |