Module | Ramaze::CoreExtensions::Array
In: | lib/ramaze/snippets/array/put_within.rb

Extensions for Array

### Methods

put_after put_before put_within

### Public Instance methods

put_after(element, object)

a = [1, 2, 3] a.put_after(2, 4) a # => [1, 2, 4, 3]

put_before(element, object)

a = [1, 2, 3] a.put_before(2, 4) a # => [1, 4, 2, 3]

put_within(object, constrain)

a = [1, 2, 3] a.put_within(4, :after => 2, :before => 3) a # => [1, 2, 4, 3]

[Validate]