Class: Darthjee::CoreExt::Array::HashBuilder Private
- Defined in:
- lib/darthjee/core_ext/array/hash_builder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class responsible for building a Hash from 2 arrays
Instance Method Summary collapse
-
#build ⇒ ::Hash
private
Builds the hash.
-
#initialize(values, keys) ⇒ HashBuilder
constructor
private
A new instance of HashBuilder.
Constructor Details
#initialize(values, keys) ⇒ HashBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of HashBuilder.
34 35 36 37 |
# File 'lib/darthjee/core_ext/array/hash_builder.rb', line 34 def initialize(values, keys) @values = values.dup @keys = keys.dup end |
Instance Method Details
#build ⇒ ::Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Builds the hash
The building happens through the pairing of keys and values
45 46 47 48 49 |
# File 'lib/darthjee/core_ext/array/hash_builder.rb', line 45 def build fixes_sizes ::Hash[[keys, values].transpose] end |