<?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: Convert your Hash keys to object properties in Ruby</title>
	<atom:link href="http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/</link>
	<description>Me code gooder one day (and more fastly)</description>
	<lastBuildDate>Sun, 29 Jan 2012 13:54:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
	<item>
		<title>By: Dan</title>
		<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/comment-page-1/#comment-454</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 16 Aug 2011 17:52:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.goodercode.com/wp/?p=31#comment-454</guid>
		<description>hash_extension is  a gem that does this. It also provides &quot;setter&quot; methods as well as ActiveRecord finders: http://enterpriserails.rubyforge.org/hash_extension/</description>
		<content:encoded><![CDATA[<p>hash_extension is  a gem that does this. It also provides &#8220;setter&#8221; methods as well as ActiveRecord finders: <a href="http://enterpriserails.rubyforge.org/hash_extension/" rel="nofollow">http://enterpriserails.rubyforge.org/hash_extension/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Wolgamott</title>
		<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/comment-page-1/#comment-404</link>
		<dc:creator>Jesse Wolgamott</dc:creator>
		<pubDate>Thu, 31 Mar 2011 16:19:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.goodercode.com/wp/?p=31#comment-404</guid>
		<description>Hey one suggestion: also implement to respond_to? if you&#039;re doing method_missing. I saw this in this stack-overflow question and think it makes a lot of sense: http://stackoverflow.com/questions/291132/method-missing-gotchas-in-ruby</description>
		<content:encoded><![CDATA[<p>Hey one suggestion: also implement to respond_to? if you&#8217;re doing method_missing. I saw this in this stack-overflow question and think it makes a lot of sense: <a href="http://stackoverflow.com/questions/291132/method-missing-gotchas-in-ruby" rel="nofollow">http://stackoverflow.com/questions/291132/method-missing-gotchas-in-ruby</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kerry</title>
		<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/comment-page-1/#comment-354</link>
		<dc:creator>kerry</dc:creator>
		<pubDate>Sat, 30 Oct 2010 15:12:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.goodercode.com/wp/?p=31#comment-354</guid>
		<description>Hashes can contain any type as the key, that line allows it to work with hashes that have other types as keys (strings, for instance).</description>
		<content:encoded><![CDATA[<p>Hashes can contain any type as the key, that line allows it to work with hashes that have other types as keys (strings, for instance).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zhenya1001</title>
		<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/comment-page-1/#comment-353</link>
		<dc:creator>zhenya1001</dc:creator>
		<pubDate>Sat, 30 Oct 2010 04:56:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.goodercode.com/wp/?p=31#comment-353</guid>
		<description>Great idea, but
why do you need this line? 
self.each { &#124;k,v&#124; return v if k.to_s.to_sym == name }

if you have 
return self[name] if key? name</description>
		<content:encoded><![CDATA[<p>Great idea, but<br />
why do you need this line?<br />
self.each { |k,v| return v if k.to_s.to_sym == name }</p>
<p>if you have<br />
return self[name] if key? name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kenan</title>
		<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/comment-page-1/#comment-237</link>
		<dc:creator>Kenan</dc:creator>
		<pubDate>Sat, 08 May 2010 05:32:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.goodercode.com/wp/?p=31#comment-237</guid>
		<description>Hey, thanks so much. I was not looking forward to figuring out how to do this (OpenStruct isn&#039;t recursive and wouldn&#039;t apply to nested stuff). But this did the trick for me. Thanks for saving me some time!</description>
		<content:encoded><![CDATA[<p>Hey, thanks so much. I was not looking forward to figuring out how to do this (OpenStruct isn&#8217;t recursive and wouldn&#8217;t apply to nested stuff). But this did the trick for me. Thanks for saving me some time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kerry</title>
		<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/comment-page-1/#comment-236</link>
		<dc:creator>kerry</dc:creator>
		<pubDate>Wed, 05 May 2010 19:51:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.goodercode.com/wp/?p=31#comment-236</guid>
		<description>When dealing with json feeds (which is what I am using this for) OpenStruct is insufficient as there are nested hashes.  So you would have to call it for element.  ie.

Given:
my_hash = { :a =&gt; :b, :c =&gt; {:d =&gt; :e, :f =&gt; :g} }

using openstruct you would have to say openstruct.c[:d] to get :e

with my solution you can simply say:

my_hash.c.d</description>
		<content:encoded><![CDATA[<p>When dealing with json feeds (which is what I am using this for) OpenStruct is insufficient as there are nested hashes.  So you would have to call it for element.  ie.</p>
<p>Given:<br />
my_hash = { :a =&gt; :b, :c =&gt; {:d =&gt; :e, :f =&gt; :g} }</p>
<p>using openstruct you would have to say openstruct.c[:d] to get :e</p>
<p>with my solution you can simply say:</p>
<p>my_hash.c.d</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kerry</title>
		<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/comment-page-1/#comment-235</link>
		<dc:creator>kerry</dc:creator>
		<pubDate>Wed, 05 May 2010 19:27:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.goodercode.com/wp/?p=31#comment-235</guid>
		<description>Thanks for the tip!

I did not know of that class.  

Sometimes though, you may not have the ability to wrap an object to access the properties or you don&#039;t want to do it over and over again.</description>
		<content:encoded><![CDATA[<p>Thanks for the tip!</p>
<p>I did not know of that class.  </p>
<p>Sometimes though, you may not have the ability to wrap an object to access the properties or you don&#8217;t want to do it over and over again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajasja Ljubetič</title>
		<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/comment-page-1/#comment-234</link>
		<dc:creator>Ajasja Ljubetič</dc:creator>
		<pubDate>Wed, 05 May 2010 18:58:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.goodercode.com/wp/?p=31#comment-234</guid>
		<description>Why not just use http://ruby-doc.org/stdlib/libdoc/ostruct/rdoc/classes/OpenStruct.html ?</description>
		<content:encoded><![CDATA[<p>Why not just use <a href="http://ruby-doc.org/stdlib/libdoc/ostruct/rdoc/classes/OpenStruct.html" rel="nofollow">http://ruby-doc.org/stdlib/libdoc/ostruct/rdoc/classes/OpenStruct.html</a> ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kerry</title>
		<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/comment-page-1/#comment-233</link>
		<dc:creator>kerry</dc:creator>
		<pubDate>Mon, 26 Apr 2010 15:57:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.goodercode.com/wp/?p=31#comment-233</guid>
		<description>yea, Groovy has some nice features.  I have been using JRuby lately at work though.</description>
		<content:encoded><![CDATA[<p>yea, Groovy has some nice features.  I have been using JRuby lately at work though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad O</title>
		<link>http://www.goodercode.com/wp/convert-your-hash-keys-to-object-properties-in-ruby/comment-page-1/#comment-232</link>
		<dc:creator>Chad O</dc:creator>
		<pubDate>Sat, 24 Apr 2010 20:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.goodercode.com/wp/?p=31#comment-232</guid>
		<description>Thanks!

I&#039;m a Ruby (and programming in general) n00b, so this seems fantastic to me! I&#039;ll have to ask my coworkers what they think and get some more experienced feedback.

But I went to a presentation on REST with Groovy, and was started to discover that Ruby didn&#039;t match up. So good work!</description>
		<content:encoded><![CDATA[<p>Thanks!</p>
<p>I&#8217;m a Ruby (and programming in general) n00b, so this seems fantastic to me! I&#8217;ll have to ask my coworkers what they think and get some more experienced feedback.</p>
<p>But I went to a presentation on REST with Groovy, and was started to discover that Ruby didn&#8217;t match up. So good work!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

