Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/bashly/extensions/array.rb

Instance Method Summary collapse

Instance Method Details

#indent(offset) ⇒ Object



2
3
4
5
6
7
# File 'lib/bashly/extensions/array.rb', line 2

def indent(offset)
  return self unless offset.positive?

  indentation = ' ' * offset
  map { |line| "#{indentation}#{line}" }
end

#nonuniqObject



9
10
11
# File 'lib/bashly/extensions/array.rb', line 9

def nonuniq
  tally.select { |_key, count| count > 1 }.keys
end