<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Easy Ruby On Rails Programming &#187; Iterators</title>
	<atom:link href="http://easyrubyonrailsprogramming.com/tag/iterators/feed/" rel="self" type="application/rss+xml" />
	<link>http://easyrubyonrailsprogramming.com</link>
	<description>The Place to be to Learn Ruby On Rails</description>
	<lastBuildDate>Sat, 24 Dec 2011 05:30:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Integers and Iterators</title>
		<link>http://easyrubyonrailsprogramming.com/development/integers-and-iterators/</link>
		<comments>http://easyrubyonrailsprogramming.com/development/integers-and-iterators/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 03:51:23 +0000</pubDate>
		<dc:creator>Avatar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming Basics]]></category>
		<category><![CDATA[Integers]]></category>
		<category><![CDATA[Iterators]]></category>

		<guid isPermaLink="false">http://easyrubyonrailsprogramming.com/development/integers-and-iterators/</guid>
		<description><![CDATA[There are a variety iterators that are useful with Ruby such as we&#8217;ve already seen in previous samples of code, such as n.times. Others are n.upto and n.downto for going up or down a series of integers and the step, which is more like the traditional loop statement. Their usage would be somewhat like: 3.times [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cs.brown.edu/~jak/proglang/cpp/stltut/tut.html"><img src="/wp-content/uploads/scraped/36.jpg"/></a>
<p>There are a variety iterators that are useful with Ruby such as we&#8217;ve already seen in previous samples of code, such as <em>n.times</em>. Others are <em>n.upto</em> and <em>n.downto</em> for going up or down a series of integers and the <em>step</em>, which is more like the traditional loop statement. Their usage would be somewhat like:</p>
<p>3.times 	{print&#8221;X &#8220;}<br />
1.upto(3) 	{[i] print i, &#8221; &#8221; }<br />
99.downto(96) 	{[i] print i, &#8221; &#8221; }<br />
50.step(70, 5) 	{[i] print i, &#8221; &#8221; }</p>
<p>Giving you the following results:<br />
X X X 1 2 3 99 98 97 96 50 55 60 65 70</p>
]]></content:encoded>
			<wfw:commentRss>http://easyrubyonrailsprogramming.com/development/integers-and-iterators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blocks and Iterators (Part 2)</title>
		<link>http://easyrubyonrailsprogramming.com/programming-language/blocks-and-iterators-part-2/</link>
		<comments>http://easyrubyonrailsprogramming.com/programming-language/blocks-and-iterators-part-2/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 09:59:58 +0000</pubDate>
		<dc:creator>Avatar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming Basics]]></category>
		<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[Blocks]]></category>
		<category><![CDATA[Iterators]]></category>

		<guid isPermaLink="false">http://easyrubyonrailsprogramming.com/programming-language/blocks-and-iterators-part-2/</guid>
		<description><![CDATA[Anytime the &#8220;yield&#8221; statement is called upon it calls on the chunk of code within the block executing it returning control to where the yield statement was called continuing on its way till the process is finished. That&#8217;s where the magic of Ruby is, that a block can be made to function like a method [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dotnetfunda.com/articles/article135.aspx"><img src="/wp-content/uploads/scraped/28.jpg"/></a>
<p>Anytime the &#8220;yield&#8221; statement is called upon it calls on the chunk of code within the block executing it returning control to where the yield statement was called continuing on its way till the process is finished. That&#8217;s where the magic of Ruby is, that a block can be made to function like a method in itself. This allows processes to embedded and used again and again with minimal coding required to achieve the desired result. The Following post would have blocks used as transactional controllers which use them to do a process that is similar somewhat to the way methods work when they are called upon.</p>
]]></content:encoded>
			<wfw:commentRss>http://easyrubyonrailsprogramming.com/programming-language/blocks-and-iterators-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blocks and Iterators (Part 1)</title>
		<link>http://easyrubyonrailsprogramming.com/development/blocks-and-iterators-part-1/</link>
		<comments>http://easyrubyonrailsprogramming.com/development/blocks-and-iterators-part-1/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 09:58:52 +0000</pubDate>
		<dc:creator>Avatar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming Basics]]></category>
		<category><![CDATA[Blocks]]></category>
		<category><![CDATA[Iterators]]></category>

		<guid isPermaLink="false">http://easyrubyonrailsprogramming.com/development/blocks-and-iterators-part-1/</guid>
		<description><![CDATA[An iterator is a method of calling on a block of code which is somewhat similar to C, Java or Perl, somewhat. The usage of iterators in Ruby does something different as opposed to other languages that share similar functions. Initially a block normally appears adjacent a method or call, that call statement is written [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://snippets.amanzi.org/2007/05/ruby-blocks-and-iterators.html"><img src="/wp-content/uploads/scraped/27.jpg"/></a>
<p>An iterator is a method of calling on a block of code which is somewhat similar to C, Java or Perl, somewhat. The usage of iterators in Ruby does something different as opposed to other languages that share similar functions. Initially a block normally appears adjacent a method or call, that call statement is written immediately after the method&#8217;s last parameter. Next, the chunk of code contained within the block is not done as it is executed rather it is remembered then has the code continue into the method. Then the block can be called as if it were a method in itself with the use of the &#8220;yield&#8221; statement. </p>
]]></content:encoded>
			<wfw:commentRss>http://easyrubyonrailsprogramming.com/development/blocks-and-iterators-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

