Sha256: c4fa3fa9a1fbda31888eb2f4afa0002aeba8e4e087a664d24055efbe7aa07f31

Contents?: true

Size: 450 Bytes

Versions: 29

Compression:

Stored size: 450 Bytes

Contents

module Spree #:nodoc:
  module Support #:nodoc:
    module CoreExtensions #:nodoc:
      module Array

        class Array
          def to_hash_keys(&block)
            Hash[*self.collect { |v|
              [v, block.call(v)]
            }.flatten]
          end

          def to_hash_values(&block)
            Hash[*self.collect { |v|
              [block.call(v), v]
            }.flatten]
          end
        end

      end
    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
kdmny-spree-0.0.1 lib/spree/support/core_extensions/array.rb
spree-0.11.4 lib/spree/support/core_extensions/array.rb
spree-0.11.3 lib/spree/support/core_extensions/array.rb
spree-0.11.2 lib/spree/support/core_extensions/array.rb
spree-0.11.1 lib/spree/support/core_extensions/array.rb
spree-0.11.0 lib/spree/support/core_extensions/array.rb
spree-0.10.2 lib/spree/support/core_extensions/array.rb
spree-0.10.1 lib/spree/support/core_extensions/array.rb
spree-0.10.0 lib/spree/support/core_extensions/array.rb
spree-0.10.0.beta lib/spree/support/core_extensions/array.rb
spree-enriquez-0.9.4 lib/spree/support/core_extensions/array.rb
spree-0.9.4 lib/spree/support/core_extensions/array.rb
spree-0.9.3 lib/spree/support/core_extensions/array.rb
spree-0.9.2 lib/spree/support/core_extensions/array.rb
spree-0.9.1 lib/spree/support/core_extensions/array.rb
spree-0.9.0 lib/spree/support/core_extensions/array.rb
spree-0.8.4 lib/spree/support/core_extensions/array.rb
spree-0.8.5 lib/spree/support/core_extensions/array.rb
spree-0.4.1 lib/spree/support/core_extensions/array.rb
spree-0.4.0 lib/spree/support/core_extensions/array.rb