Class: Array

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

Instance Method Summary collapse

Instance Method Details

#indent(offset) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/bashly/extensions/array.rb', line 4

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

  indentation = ' ' * offset
  indenter = Bashly::IndentationHelper.new indentation

  map { |line| indenter.indent line }
end

#nonuniqObject



13
14
15
# File 'lib/bashly/extensions/array.rb', line 13

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