Re: dynamic loop in a hash

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

Colin Law wrote in post #1071227:
> On 3 August 2012 22:03, Sam Ginko
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
>>   i.day.ago.to_date => { :coder=>@numdeployed,
:imedidata=>@numdeployed,
>> :balance=>@numdeployed, :CTMS=>@numdeployed },
>>   i += 1
>> end
>>
>>
>> Original Data Hash
>>
>> @data = {
>>       1.day.ago.to_date => { :coder=>10, :imedidata=>40,
:balance=>10,
>> :CTMS=>40 },
>
> How can you have a Date object as the key to a hash?  Show us for an
> actual date what you want to see here.

the date object has to be there. That helps to build the javascript that
creates the graphical timeline.