Method: Insertion#initialize

Defined in:
lib/yard/core_ext/insertion.rb

#initialize(list, value) ⇒ Insertion

Creates an insertion object on a list with a value to be inserted. To finalize the insertion, call #before or #after on the object.

Parameters:

  • list (Array)

    the list to perform the insertion on

  • value (Object)

    the value to insert



14
15
16
17
# File 'lib/yard/core_ext/insertion.rb', line 14

def initialize(list, value)
  @list = list
  @values = (Array === value ? value : [value])
end