Class: HashCollection
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- HashCollection
- Defined in:
- lib/hash_collection.rb
Overview
A decorator for handling a collection of hashes with similar keys.
Instance Method Summary collapse
-
#to_a ⇒ Object
Example:.
Instance Method Details
#to_a ⇒ Object
Example:
foo = [
{a: 1, b: 2},
{b: 3, c: 4}
]
= HashCollection.new(foo)
.to_a => [[:a, 1, nil], [:b, 2, 3], [:c, nil, 4]]
18 19 20 21 |
# File 'lib/hash_collection.rb', line 18 def to_a keys = find_unique_keys build_items(keys) end |