Michael Fellinger
7/26/2007 1:40:00 AM
> Array.each returns self. Your function will have to store the results of the
> split lengths somehow.
>
> Such as:
>
> def get_component_info(bom)
> result = Array.new
> bom.each { |line|
> result << line.split("\t").length
> }
> result.join("\n")
> end
Make that:
def get_component_info(bom)
bom.map{|l| l.split("\t").size }.join("\n")
end