Class: Representable::Pipeline::Function::Insert

Inherits:
Object
  • Object
show all
Defined in:
lib/representable/insert.rb

Instance Method Summary collapse

Instance Method Details

#call(arr, func, options) ⇒ Object



5
6
7
8
9
10
# File 'lib/representable/insert.rb', line 5

def call(arr, func, options)
  arr = arr.dup
  delete!(arr, func) if options[:delete]
  replace!(arr, options[:replace], func) if options[:replace]
  arr
end