S
Shai Rosenfeld
is there a nice clean method to do the following:
a = Module.new
att1 => 1, :att2 => "abc")
b = Module.new
att1 => 1, :att2 => "adfbc")
c = Module.new
att1 => 2, :att2 => "abcasdf")
d = Module.new
att1 => 1, :att2 => "ddddf")
e = Module.new
att1 => 2, :att2 => "ddddf")
f = Module.new
att1 => 3, :att2 => "ddddf")
array = [a,b,c,d,e,f]
# i want to take the 'array' var and make it into seperate arrays
according to the att1 attribute, i.e, resulting in the example above to
r1=[a,b,d]
r2=[c,e]
r3=[f]
any nice way to do this?
thx
a = Module.new
b = Module.new
c = Module.new
d = Module.new
e = Module.new
f = Module.new
array = [a,b,c,d,e,f]
# i want to take the 'array' var and make it into seperate arrays
according to the att1 attribute, i.e, resulting in the example above to
r1=[a,b,d]
r2=[c,e]
r3=[f]
any nice way to do this?
thx