class Array

Array helpers

Public Instance Methods

cap_first() click to toggle source

Capitalize first letter of each element

@return [Array] capitalized items

# File lib/doing/array/array.rb, line 31
def cap_first
  map(&:cap_first)
end
good?() click to toggle source

Tests if object is nil or empty

@return [Boolean] true if object is defined and has content

# File lib/doing/good.rb, line 59
def good?
  !nil? && !empty?
end
utf8() click to toggle source

Force UTF-8 encoding of strings in array

@return [Array] Encoded lines

# File lib/doing/array/array.rb, line 17
def utf8
  c = self.class
  if String.method_defined? :force_encoding
    replace c.new(map(&:utf8))
  else
    self
  end
end