GeekInterview.com
Series: Subject: Topic:
Question: 18 of 22

How is an iterator handled in Ruby?

Asked by: Robert | Member Since Jul-2006 | Asked on: Mar 25th, 2007

View all questions by Robert   View all answers by Robert

Showing Answers 1 - 1 of 1 Answers
Ayyappan K

Answered On : Sep 21st, 2007

Iterator is handled using keyword 'each' in ruby.
For example
$no=[1,2,3]
then we can use iterator as
$no.each do |l|
puts l
end
Above prints the values of an array $no which is accomplished using iterator.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.