<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to access a class method from an instance</title>
	<link>http://www.rubyfleebie.com/how-to-access-a-class-method-from-an-instance/</link>
	<description>Because programming should be fun</description>
	<pubDate>Sat, 22 Nov 2008 04:29:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.2</generator>

	<item>
		<title>By: Dan</title>
		<link>http://www.rubyfleebie.com/how-to-access-a-class-method-from-an-instance/#comment-130</link>
		<author>Dan</author>
		<pubDate>Sun, 15 Apr 2007 22:13:50 +0000</pubDate>
		<guid>http://www.rubyfleebie.com/how-to-access-a-class-method-from-an-instance/#comment-130</guid>
					<description>I like it. Most languages don't make the difference between a call to a class method and a call to an instance method.</description>
		<content:encoded><![CDATA[<p>I like it. Most languages don&#8217;t make the difference between a call to a class method and a call to an instance method.</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: manveru</title>
		<link>http://www.rubyfleebie.com/how-to-access-a-class-method-from-an-instance/#comment-139</link>
		<author>manveru</author>
		<pubDate>Wed, 18 Apr 2007 09:21:00 +0000</pubDate>
		<guid>http://www.rubyfleebie.com/how-to-access-a-class-method-from-an-instance/#comment-139</guid>
					<description>I certainly don't mind if you do this in your code, but i suggest you use

def self.laughs

and also think about how many you have to change when you suddenly decide that Monkey should be called Primate... using self in these cases can save you some typing ;)

see following post which is loosly related:
http://www.oreillynet.com/ruby/blog/2007/04/nubygems_be_kind_to_your_child.html</description>
		<content:encoded><![CDATA[<p>I certainly don&#8217;t mind if you do this in your code, but i suggest you use</p>
<p>def self.laughs</p>
<p>and also think about how many you have to change when you suddenly decide that Monkey should be called Primate&#8230; using self in these cases can save you some typing <img src='http://www.rubyfleebie.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>see following post which is loosly related:<br />
<a href="http://www.oreillynet.com/ruby/blog/2007/04/nubygems_be_kind_to_your_child.html" rel="nofollow">http://www.oreillynet.com/ruby/blog/2007/04/nubygems_be_kind_to_your_child.html</a></p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Frank</title>
		<link>http://www.rubyfleebie.com/how-to-access-a-class-method-from-an-instance/#comment-147</link>
		<author>Frank</author>
		<pubDate>Wed, 18 Apr 2007 16:42:13 +0000</pubDate>
		<guid>http://www.rubyfleebie.com/how-to-access-a-class-method-from-an-instance/#comment-147</guid>
					<description>You are bringing up a good point. It's true that if you change your class name, you could have some tedious search and replace operations to do depending on the size of your class. But personally it's a price I'm willing to pay. To me it's more a matter of clarity than anything else. The fact that you can have the word "self" pointing to different things inside the same class (sometimes to an instance, sometimes to the class itself) just doesn't please me that much. However, I have to agree that this practice is more convenient in some situations.

Thanks for your comment</description>
		<content:encoded><![CDATA[<p>You are bringing up a good point. It&#8217;s true that if you change your class name, you could have some tedious search and replace operations to do depending on the size of your class. But personally it&#8217;s a price I&#8217;m willing to pay. To me it&#8217;s more a matter of clarity than anything else. The fact that you can have the word &#8220;self&#8221; pointing to different things inside the same class (sometimes to an instance, sometimes to the class itself) just doesn&#8217;t please me that much. However, I have to agree that this practice is more convenient in some situations.</p>
<p>Thanks for your comment</p>
]]></content:encoded>
				</item>
</channel>
</rss>
