Sha256: 42c34156f2020a6ac4a04769a43a55e1131e12b0397a51d949f0b46b907db99c
Contents?: true
Size: 331 Bytes
Versions: 20
Compression:
Stored size: 331 Bytes
Contents
class Array::HashBuilder attr_accessor :values, :keys def initialize(values, keys) @values = values.dup @keys = keys.dup end def build fixes_sizes Hash[[keys, values].transpose] end private def fixes_sizes values.concat Array.new(keys.size - values.size) if keys.size > values.size end end
Version data entries
20 entries across 20 versions & 2 rubygems