<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to turn a string into CamelCase in Ruby</title>
	<link>http://nealenssle.com/blog/2007/07/21/how-to-turn-a-string-into-a-wikiword-in-ruby/</link>
	<description></description>
	<pubDate>Thu, 28 Aug 2008 08:20:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>

	<item>
		<title>by: Jake</title>
		<link>http://nealenssle.com/blog/2007/07/21/how-to-turn-a-string-into-a-wikiword-in-ruby/#comment-542</link>
		<pubDate>Thu, 30 Aug 2007 13:59:04 +0000</pubDate>
		<guid>http://nealenssle.com/blog/2007/07/21/how-to-turn-a-string-into-a-wikiword-in-ruby/#comment-542</guid>
					<description>Oh, and I don't think you even need the return statement. 
I'm pretty sure Ruby methods automagically return the last thing that gets evaluated within.</description>
		<content:encoded><![CDATA[<p>Oh, and I don&#8217;t think you even need the return statement.<br />
I&#8217;m pretty sure Ruby methods automagically return the last thing that gets evaluated within.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jake</title>
		<link>http://nealenssle.com/blog/2007/07/21/how-to-turn-a-string-into-a-wikiword-in-ruby/#comment-541</link>
		<pubDate>Thu, 30 Aug 2007 13:56:20 +0000</pubDate>
		<guid>http://nealenssle.com/blog/2007/07/21/how-to-turn-a-string-into-a-wikiword-in-ruby/#comment-541</guid>
					<description>If you're in Rails, you can take advantage of the &lt;a href="http://api.rubyonrails.com/classes/Inflector.html" rel="nofollow"&gt;Inflector class&lt;/a&gt; and do something like this:

&#62;&#62; phrase = 'my Dog hAs FlEas'
=&#62; "my Dog hAs FlEas"
&#62;&#62; phrase.downcase.gsub(/\s/, '_').camelize
=&#62; "MyDogHasFleas"

I only know this because the inflector's "titleize" method is great if you want to "capitalize" multi-word phrases.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re in Rails, you can take advantage of the <a href="http://api.rubyonrails.com/classes/Inflector.html" rel="nofollow">Inflector class</a> and do something like this:</p>
<p>&gt;&gt; phrase = &#8216;my Dog hAs FlEas&#8217;<br />
=&gt; &#8220;my Dog hAs FlEas&#8221;<br />
&gt;&gt; phrase.downcase.gsub(/\s/, &#8216;_&#8217;).camelize<br />
=&gt; &#8220;MyDogHasFleas&#8221;</p>
<p>I only know this because the inflector&#8217;s &#8220;titleize&#8221; method is great if you want to &#8220;capitalize&#8221; multi-word phrases.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
