Class: Insertion
- Inherits:
-
Object
- Object
- Insertion
- Defined in:
- lib/yard/core_ext/array.rb
Overview
The Insertion class inserts a value before or after another value in a list.
Instance Method Summary
- - (Object) after(val, ignore_subsections = true) Inserts the value after val.
- - (Object) before(val) Inserts the value before val.
- - (Insertion) initialize(list, value) constructor Creates an insertion object on a list with a value to be inserted.
Constructor Details
Instance Method Details
- (Object) after(val, ignore_subsections = true)
Inserts the value after val.
42 |
# File 'lib/yard/core_ext/array.rb', line 42 def after(val, ignore_subsections = true) insertion(val, 1, ignore_subsections) end |
- (Object) before(val)
Inserts the value before val
33 |
# File 'lib/yard/core_ext/array.rb', line 33 def before(val) insertion(val, 0) end |