the array is in has a method that takes an array of string values.
endfoo(:a, :b, :c)
You can read about Array#zip and Array#flatten on the documentation
pages, or by using ri from the terminal, e.g.$ ri Array#zip
Cheers,
Daniel
The above works great if you’re limited to the standard library.
However, if you’re allowed to use third party packages, I prefer hash
slices for this sort of thing:
require ‘hashslice’
def adddata(data)
@pageData[@labels] = *data
end
IMHO this behavior should exist in the current Hash class.
Regards,
Dan
This communication is the property of Qwest and may contain confidential
or
privileged information. Unauthorized use of this communication is
strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and
destroy
all copies of the communication and any attachments.