Maybe you can refer to Enumerable#slice_before

Here's a sample code:

a = ["Member","Friends","Hello","Components","Family","Lastname"]
b = a.slice_before {|elem| elem == "Components" }.to_a
p b[0] #=> ["Member", "Friends", "Hello"]
p b[1] #=> ["Components", "Family", "Lastname"]

Joey

-- 
Posted via http://www.ruby-forum.com/.