Hi,
Is there a concise/ruby way to do the following:
[Note: 1 and 2 below are not related.]
(1)
for p in [email protected]_items[k].shipment_lines.length
shipline_qty = shipline_qty +
@order.line_items[k].shipment_lines[p].quantity
end
(2)
ts = Array.new
for tk in s.trackings
ts.push(tk)
end
Thanks.
Hi, I’m not an expert so
(1)
for p in [email protected]_items[k].shipment_lines.length
shipline_qty +=
@order.line_items[k].shipment_lines[p].quantity
end
(2)
ts = Array.new
s.trackings.each { |tk| ts << tk }
Hope that helps!
2006/1/24, Mufaddal K. [email protected]:
On 1/24/06, Mufaddal K. [email protected] wrote:
end
I’m sure there’s a better way to do this one also but I’m a relative
Ruby
newb myself… maybe someone else can come up with something;
maybe something like:
([email protected]_items[k].shipment_lines.length).each do |p|
shipline_qty +=
@order.line_items[k].shipment_lines[p].quantity
(2)
ts = Array.new
for tk in s.trackings
ts.push(tk)
end
Thanks.
ts = s.trackings.map { |tk| tk }