Class: Array

Inherits:
Object show all
Defined in:
lib/omu_support/core_ext/array.rb

Instance Method Summary collapse

Instance Method Details

#clip(number_of_last_elements = 1) ⇒ Object



4
5
6
# File 'lib/omu_support/core_ext/array.rb', line 4

def clip(number_of_last_elements = 1)
  take size - number_of_last_elements
end

#join_affixed(**options) ⇒ Object



8
9
10
11
12
# File 'lib/omu_support/core_ext/array.rb', line 8

def join_affixed(**options)
  must_be_any_of! [String]

  "#{Array(options[:prefix]).join}#{join options[:interfix]}#{Array(options[:suffix]).join}"
end