J
Jim Burgess
Hi,
I have an array consisting of "Event" objects, and string elements which
contain the names of months.
It looks like this:
[#<Event:0x4d4cf78>, #<Event:0x4d4d470>, "MARCH", #<Event:0x4d4dc08>,
#<Event:0x4d4e100>, "FEBRUARY", #<Event:0x4d4e898>,"JANUARY"]
Currently the events precede the months they are ordered to.
Is there any way to reverse this so that the months precede the
events?
Like this:
["MARCH", #<Event:0x4d4cf78>, #<Event:0x4d4d470>,
"FEBRUARY",#<Event:0x4d4dc08>, #<Event:0x4d4e100>, "JANUARY",
#<Event:0x4d4e898>]
I have been scouring the documentation for ages and have also googled
everything I can think of (e.g. Array#split) to try and find a solution,
but with no luck.
Can anyone point me in the right direction.
I am grateful for any help.
I have an array consisting of "Event" objects, and string elements which
contain the names of months.
It looks like this:
[#<Event:0x4d4cf78>, #<Event:0x4d4d470>, "MARCH", #<Event:0x4d4dc08>,
#<Event:0x4d4e100>, "FEBRUARY", #<Event:0x4d4e898>,"JANUARY"]
Currently the events precede the months they are ordered to.
Is there any way to reverse this so that the months precede the
events?
Like this:
["MARCH", #<Event:0x4d4cf78>, #<Event:0x4d4d470>,
"FEBRUARY",#<Event:0x4d4dc08>, #<Event:0x4d4e100>, "JANUARY",
#<Event:0x4d4e898>]
I have been scouring the documentation for ages and have also googled
everything I can think of (e.g. Array#split) to try and find a solution,
but with no luck.
Can anyone point me in the right direction.
I am grateful for any help.