<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Bring your methods to life with punctuation</title>
	<atom:link href="http://www.rubyfleebie.com/bring-your-methods-to-life-with-punctuation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rubyfleebie.com/bring-your-methods-to-life-with-punctuation/</link>
	<description>Because programming should be fun</description>
	<lastBuildDate>Thu, 15 Jul 2010 19:48:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Frank</title>
		<link>http://www.rubyfleebie.com/bring-your-methods-to-life-with-punctuation/comment-page-1/#comment-46</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Sat, 31 Mar 2007 13:12:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/bring-your-methods-to-life-with-punctuation/#comment-46</guid>
		<description>Hey Jamal,

The &quot;?&quot; and &quot;!&quot; characters are not doing something special on their own. It&#039;s just that you can include them in the name of your methods if you want. It&#039;s only a convention to use the &quot;?&quot; character in methods that does nothing worth of mention other than returning yes or no. As it&#039;s just a convention to use the &quot;!&quot; character in methods that do something destructive or &quot;dangerous&quot;. You could (but should not) use them for other purpose.

So, if you want to write : if my_method? ...

You would have to define it this way :

def my_method?
   return true #or false, or anything you want
end

If you want to write : destroy!

You would have to define it this way :

def destroy!
  #Do something destructive like deleting all rows of a table in a DB
end

I hope it does answer your question</description>
		<content:encoded><![CDATA[<p>Hey Jamal,</p>
<p>The &#8220;?&#8221; and &#8220;!&#8221; characters are not doing something special on their own. It&#8217;s just that you can include them in the name of your methods if you want. It&#8217;s only a convention to use the &#8220;?&#8221; character in methods that does nothing worth of mention other than returning yes or no. As it&#8217;s just a convention to use the &#8220;!&#8221; character in methods that do something destructive or &#8220;dangerous&#8221;. You could (but should not) use them for other purpose.</p>
<p>So, if you want to write : if my_method? &#8230;</p>
<p>You would have to define it this way :</p>
<p>def my_method?<br />
   return true #or false, or anything you want<br />
end</p>
<p>If you want to write : destroy!</p>
<p>You would have to define it this way :</p>
<p>def destroy!<br />
  #Do something destructive like deleting all rows of a table in a DB<br />
end</p>
<p>I hope it does answer your question</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamal Soueidan</title>
		<link>http://www.rubyfleebie.com/bring-your-methods-to-life-with-punctuation/comment-page-1/#comment-43</link>
		<dc:creator>Jamal Soueidan</dc:creator>
		<pubDate>Fri, 30 Mar 2007 23:51:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/bring-your-methods-to-life-with-punctuation/#comment-43</guid>
		<description>Thanks for that :)

So how do you do your own method like that?

For: ?
def method
 return true or false
end

if method? 
 #do that
end

For: !

def method
  raise &quot;exception&quot;
end

method!
rescue &quot;exception&quot;

or something like that?

Can you tell us how to use both ! or ? or nothing ?, a article/post about methods will be really great :D</description>
		<content:encoded><![CDATA[<p>Thanks for that :)</p>
<p>So how do you do your own method like that?</p>
<p>For: ?<br />
def method<br />
 return true or false<br />
end</p>
<p>if method?<br />
 #do that<br />
end</p>
<p>For: !</p>
<p>def method<br />
  raise &#8220;exception&#8221;<br />
end</p>
<p>method!<br />
rescue &#8220;exception&#8221;</p>
<p>or something like that?</p>
<p>Can you tell us how to use both ! or ? or nothing ?, a article/post about methods will be really great :D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://www.rubyfleebie.com/bring-your-methods-to-life-with-punctuation/comment-page-1/#comment-40</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Thu, 29 Mar 2007 20:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/bring-your-methods-to-life-with-punctuation/#comment-40</guid>
		<description>unless user logged_in? 

sounds pretty nice</description>
		<content:encoded><![CDATA[<p>unless user logged_in? </p>
<p>sounds pretty nice</p>
]]></content:encoded>
	</item>
</channel>
</rss>
