Sha256: 058f9287778f1d341e34157660409cabd2f3166d55c57caf278b4a25d5b43c3d

Contents?: true

Size: 660 Bytes

Versions: 8

Compression:

Stored size: 660 Bytes

Contents

# frozen_string_literal: true

require_relative 'tags'
require_relative 'nested_hash'
require_relative 'cleanup'

module Doing
  class ::Array
    include ArrayTags
    include ArrayNestedHash
    include ArrayCleanup
    ##
    ## Force UTF-8 encoding of strings in array
    ##
    ## @return     [Array] Encoded lines
    ##
    def utf8
      c = self.class
      if String.method_defined? :force_encoding
        replace c.new(map(&:utf8))
      else
        self
      end
    end

    ##
    ## Capitalize first letter of each element
    ##
    ## @return     [Array] capitalized items
    ##
    def cap_first
      map(&:cap_first)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
doing-2.1.88 lib/doing/array/array.rb
doing-2.1.87 lib/doing/array/array.rb
doing-2.1.86 lib/doing/array/array.rb
doing-2.1.85 lib/doing/array/array.rb
doing-2.1.84 lib/doing/array/array.rb
doing-2.1.83 lib/doing/array/array.rb
doing-2.1.82 lib/doing/array/array.rb
doing-2.1.81 lib/doing/array/array.rb