Class: Array::HashBuilder
- Inherits:
-
Object
- Object
- Array::HashBuilder
- Defined in:
- lib/array/hash_builder.rb
Instance Attribute Summary collapse
-
#keys ⇒ Object
Returns the value of attribute keys.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(values, keys) ⇒ HashBuilder
constructor
A new instance of HashBuilder.
Constructor Details
#initialize(values, keys) ⇒ HashBuilder
Returns a new instance of HashBuilder.
4 5 6 7 |
# File 'lib/array/hash_builder.rb', line 4 def initialize(values, keys) @values = values.dup @keys = keys.dup end |
Instance Attribute Details
#keys ⇒ Object
Returns the value of attribute keys.
2 3 4 |
# File 'lib/array/hash_builder.rb', line 2 def keys @keys end |
#values ⇒ Object
Returns the value of attribute values.
2 3 4 |
# File 'lib/array/hash_builder.rb', line 2 def values @values end |
Instance Method Details
#build ⇒ Object
9 10 11 12 13 |
# File 'lib/array/hash_builder.rb', line 9 def build fixes_sizes Hash[[keys, values].transpose] end |