I have a helper function that generates a tree and i''m trying to get
the
sum of time for each element in the whole tree.
def tree(time)
print element
time = element.time
tree(time)
end function
the script works but i''m having trouble getting the total time. as i
currently have it set up the total_time is reset each time it starts a
new branch.
is there some way i can set up a global variable or something similar in
my helper function so when the tree goes back up a branch i don''t lose
the time calculated for that branch?
you can see what i mean here:
http://wl-dev.kuliksco.com/manufactures/247
i am only getting the total time for the last branch in the tree.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---