Sha256: ebc34032557b07548b15d386936dc3db4f1d23976f17abade2803a6d84396a5e

Contents?: true

Size: 250 Bytes

Versions: 6

Compression:

Stored size: 250 Bytes

Contents

class Array

  # Convert array of namespaces to constant.
  #
  # @example
  #   %i(AIPP AIP Base).constantize   # => AIPP::AIP::Base
  #
  # @return [Class, Module] converted array
  def constantize
    map(&:to_s).join('::').constantize
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
aipp-2.1.1 lib/core_ext/array.rb
aipp-2.1.0 lib/core_ext/array.rb
aipp-2.0.3 lib/core_ext/array.rb
aipp-2.0.2 lib/core_ext/array.rb
aipp-2.0.1 lib/core_ext/array.rb
aipp-2.0.0 lib/core_ext/array.rb