Sha256: abecd0e751cc1feb824ec917ebf8f571c614ed47362929359c3b3210c71b901e

Contents?: true

Size: 626 Bytes

Versions: 16

Compression:

Stored size: 626 Bytes

Contents

## Array
### #map_to_hash
map returning a hash with the original array for keys

```ruby
array = %w(a ab)
arrays.map_to_hash { |val| val.length }
{ 'a' => 1, 'b' => 2 }
```

### #chain_map
applies map in a chain

```ruby
array = [ :a, :long_name, :sym ]
array.chain_map(:to_s, :size, :to_s)
[ '1', '9', '3' ]
```

```ruby
array = [ :a, :long_name, :sym ]
array.chain_map(:to_s, :size) { |v| "final: #{v}" }
[ 'final: 1', 'final: 9', 'final: 3' ]
```

### #as_hash
Creates a hash from the array using the argumen array as keys

```ruby
  [1, 2, 3].as_hash %w(a b c)
```
returns
```ruby
  { 'a' => 1, 'b' => 2, 'c' => 3 } }
```

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
darthjee-core_ext-1.7.1 ARRAY_README.md
darthjee-core_ext-1.7.0 ARRAY_README.md
darthjee-core_ext-1.6.2 ARRAY_README.md
darthjee-core_ext-1.6.1 ARRAY_README.md
darthjee-core_ext-1.6.0 ARRAY_README.md
darthjee-core_ext-1.5.6 ARRAY_README.md
darthjee-core_ext-1.5.5 ARRAY_README.md
darthjee-core_ext-1.5.4 ARRAY_README.md
darthjee-core_ext-1.5.3 ARRAY_README.md
darthjee-core_ext-1.5.2 ARRAY_README.md
darthjee-core_ext-1.5.1 ARRAY_README.md
darthjee-core_ext-1.5.0 ARRAY_README.md
darthjee-core_ext-1.4.1 ARRAY_README.md
darthjee-core_ext-1.4.0 ARRAY_README.md
darthjee-core_ext-1.3.1 ARRAY_README.md
darthjee-core_ext-1.3.0 ARRAY_README.md