Re: dynamic loop in a hash

Sam Ginko
Fri, 03 Aug 2012 22:11:40 -0000

Daniel Mantilla wrote in post #1071237:
> This should work:
>
> items = 12.times.map { [i.day.ago.to_date, { :coder=>@numdeployed,
> :imedidata=>@numdeployed,
> :balance=>@numdeployed, :CTMS=>@numdeployed } ] }.flatten
> result = Hash[*items]
>
> Daniel

Thanks Daniel, I will try this.