Sha256: f1f7aaecb4f7260414219258bc844eecc28a48c120609ba101d1be95809354e4

Contents?: true

Size: 622 Bytes

Versions: 2

Compression:

Stored size: 622 Bytes

Contents

# frozen_string_literal: true
class Array
  # Places values before or after another object (by value) in
  # an array. This is used in tandem with the before and after
  # methods of the {Insertion} class.
  #
  # @example Places an item before another
  #   [1, 2, 3].place(4).before(3) # => [1, 2, 4, 3]
  # @example Places an item after another
  #   [:a, :b, :c].place(:x).after(:a) # => [:a, :x, :b, :c]
  # @param [Array] values value to insert
  # @return [Insertion] an insertion object to
  # @see Insertion#before
  # @see Insertion#after
  def place(*values) Insertion.new(self, values) end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yard-0.9.18 lib/yard/core_ext/array.rb
yard-0.9.17 lib/yard/core_ext/array.rb