Possible Duplicate:
Interested in what the “<<” does
I read Ruby class inheritance: What is `<<` (double less than)?. I understood it helps to create methods for instances (kind of inheritance). But I came across a code:
threads << Thread.new(page) { |myPage|
h = Net::HTTP.new(myPage, 80)
puts "Fetching: #{myPage}"
resp, data = h.get('/', nil )
puts "Got #{myPage}: #{resp.message}"
}
where threads
is an array. Could somebody explain the usage of <<
with objects instead of classes?