Sha256: 96316203987d985a61637ac7eea9795371f2aab93109675feab88e91b1d76c39

Contents?: true

Size: 303 Bytes

Versions: 4

Compression:

Stored size: 303 Bytes

Contents

class Array
  def to_h
    Hash[self]
  end

  def to_data
    map(&:to_h)
  end

  def map_to(field)
    self.map { |hash| hash[field] }
  end

  def exclude?(value)
    !include?(value)
  end

  def to_hash_with_indexes_as_keys
    each_with_index.map { |option,index| [index,option] }.to_h
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/core_extensions-0.0.4/lib/core_extensions/array.rb
core_extensions-0.0.4 lib/core_extensions/array.rb
core_extensions-0.0.3 lib/core_extensions/array.rb
core_extensions-0.0.2 lib/core_extensions/array.rb