<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-3718956085911858962.post277306284681829738..comments</id><updated>2011-07-22T14:13:28.679+05:30</updated><category term='barcamp'/><category term='continuous integration'/><category term='news'/><category term='quirks'/><category term='web'/><category term='books'/><category term='bug'/><category term='recruiting'/><category term='registry'/><category term='spawn'/><category term='gwt'/><category term='methodology'/><category term='symlinks'/><category term='innovative'/><category term='dzone'/><category term='DCB1'/><category term='junction'/><category term='css'/><category term='evolving'/><category term='devcampbangalore'/><category term='utf8'/><category term='rails'/><category term='video'/><category term='c42'/><category term='.net'/><category term='performance'/><category term='cc.rb'/><category term='xp'/><category term='training'/><category term='rant'/><category term='undernet'/><category term='resharper'/><category term='JSNI'/><category term='scala'/><category term='java'/><category term='refactoring'/><category term='activ'/><category term='anti-pattern'/><category term='security'/><category term='intro'/><category term='humour'/><category term='thoughtworks'/><category term='intellij'/><category term='india'/><category term='barcampbangalore5'/><category term='hackdayindia'/><category term='django'/><category term='links'/><category term='mochikit'/><category term='hiring'/><category term='mvc'/><category term='leisure'/><category term='interview'/><category term='photo'/><category term='brug'/><category term='twb'/><category term='opinion'/><category term='content repository'/><category term='digg'/><category term='practices'/><category term='mongrel'/><category term='mac'/><category term='offshore'/><category term='darkness'/><category term='OOP'/><category term='quality'/><category term='fun'/><category term='feedburner'/><category term='testing'/><category term='release'/><category term='architecture'/><category term='musings'/><category term='nasscom'/><category term='gotcha'/><category term='prototype'/><category term='ide'/><category term='ruby'/><category term='rdt'/><category term='dragdrop'/><category term='jcr'/><category term='skills'/><category term='javascript'/><category term='bangpypers'/><category term='tomcat'/><category term='event'/><category term='conference'/><category term='osx'/><category term='sysinternals'/><category term='announcement'/><category term='GI'/><category term='bangalore'/><category term='unconference'/><category term='agile'/><category term='python'/><category term='plugin'/><category term='analysis'/><category term='javaone'/><category term='browser'/><category term='enterprise'/><category term='ci'/><category term='barcampbangalore4'/><category term='windows'/><category term='irc'/><category term='tdd'/><category term='tweak'/><category term='recruitment'/><category term='rubyconf'/><category term='jackrabbit'/><category term='hack'/><category term='dcb2'/><category term='oss'/><category term='cycle'/><category term='tool'/><category term='feedflare'/><category term='REST'/><category term='feedflareunit'/><category term='ajax'/><category term='howto'/><category term='programming'/><category term='bcb4'/><category term='startup'/><category term='deployment'/><category term='tw'/><category term='lucene'/><category term='metaprogramming'/><category term='2010'/><category term='noob'/><category term='dining table'/><category term='YUI'/><category term='tibco'/><category term='versioning'/><category term='literature'/><category term='jquery'/><category term='activeresource'/><category term='cool'/><category term='rubyconf2011'/><category term='blogger'/><category term='call'/><category term='twitter'/><category term='functional programming'/><category term='search'/><category term='mingle'/><category term='microsoft'/><category term='book review verdict:read'/><category term='jruby'/><category term='goldberg'/><category term='wrest'/><title type='text'>Comments on Electric Sheep Blog: Loading classes from strings in Ruby</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.sidu.in/feeds/277306284681829738/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html'/><author><name>Sidu</name><uri>http://www.blogger.com/profile/11938300811286150164</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.flickr.com/74/186326016_765e6e2222_s.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-4294241173994936297</id><published>2010-08-31T00:23:04.210+05:30</published><updated>2010-08-31T00:23:04.210+05:30</updated><title type='text'>Sidu and Travis: thanks for clarifying this.  I am...</title><content type='html'>Sidu and Travis: thanks for clarifying this.  I am able to use Travis&amp;#39; way to retrieve a class nested within a module.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/4294241173994936297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/4294241173994936297'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html?showComment=1283194384210#c4294241173994936297' title=''/><author><name>Scott Smith</name><uri>http://blog.scottnelsonsmith.com</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-277306284681829738' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/277306284681829738' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1170815332'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-5627618181430417418</id><published>2010-06-14T23:16:56.792+05:30</published><updated>2010-06-14T23:16:56.792+05:30</updated><title type='text'>I haven&amp;#39;t benchmarked this, but you can also d...</title><content type='html'>I haven&amp;#39;t benchmarked this, but you can also do:&lt;br /&gt;&lt;br /&gt;Module.const_get(&amp;quot;ModuleName&amp;quot;).const_get(&amp;quot;ClassName&amp;quot;)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/5627618181430417418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/5627618181430417418'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html?showComment=1276537616792#c5627618181430417418' title=''/><author><name>Travis Reeder</name><uri>http://www.blogger.com/profile/01398330633165910535</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh5.ggpht.com/_-J9DSaseOX8/Sa2MZjrhm0I/AAAAAAAAUnQ/rFP2Aq9F_9M/s576/IMG_0760.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-277306284681829738' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/277306284681829738' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1502598432'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-1448261143284002243</id><published>2010-03-22T07:49:00.428+05:30</published><updated>2010-03-22T07:49:00.428+05:30</updated><title type='text'>I added the Rails 2.3.5 constantize to the benchma...</title><content type='html'>I added the Rails 2.3.5 constantize to the benchmarks above, and in my results it&amp;#39;s over 7 times slower than the &amp;quot;simple invocation&amp;quot; and 4 times slower than const_get.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/1448261143284002243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/1448261143284002243'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html?showComment=1269224340428#c1448261143284002243' title=''/><author><name>Mike Boone</name><uri>http://boonedocks.net/mike</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-277306284681829738' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/277306284681829738' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-360270640'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-4951336237163510772</id><published>2009-10-26T01:59:06.854+05:30</published><updated>2009-10-26T01:59:06.854+05:30</updated><title type='text'>Yes, I have!!! But #constantize is a Rails (active...</title><content type='html'>Yes, I have!!! But #constantize is a Rails (activesupport) extension, so without Rails, no #constantize.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/4951336237163510772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/4951336237163510772'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html?showComment=1256502546854#c4951336237163510772' title=''/><author><name>Sidu</name><uri>http://www.blogger.com/profile/11938300811286150164</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.flickr.com/74/186326016_765e6e2222_s.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-277306284681829738' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/277306284681829738' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-331438855'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-5953159518452948056</id><published>2009-10-25T09:04:29.211+05:30</published><updated>2009-10-25T09:04:29.211+05:30</updated><title type='text'>Have you tried &amp;quot;MyClassName&amp;quot;.constantize...</title><content type='html'>Have you tried &amp;quot;MyClassName&amp;quot;.constantize.new ???</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/5953159518452948056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/5953159518452948056'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html?showComment=1256441669211#c5953159518452948056' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-277306284681829738' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/277306284681829738' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1533384583'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-9150981013760971487</id><published>2009-06-04T08:58:07.671+05:30</published><updated>2009-06-04T08:58:07.671+05:30</updated><title type='text'>If you have a string containing a potential class ...</title><content type='html'>If you have a string containing a potential class name and you&amp;#39;re not sure if its formatted correctly for whatever reason before you use &amp;#39;eval&amp;#39; or &amp;#39;Kernel.const_get&amp;#39;, you can use &amp;#39;Kernel.subclasses_of(ActiveRecord::Base).member?(YourClass)&amp;#39; to check if it exists so you don&amp;#39;t get a &amp;#39;LoadError: ./activesupport-2.3.2/lib/active_support/dependencies.rb:426:in `load_missing_constant&amp;#39;&amp;#39;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/9150981013760971487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/9150981013760971487'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html?showComment=1244086087671#c9150981013760971487' title=''/><author><name>Dave Rogers</name><uri>http://www.blogger.com/profile/03159006525227734356</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-277306284681829738' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/277306284681829738' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-837375744'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-8713895322732366768</id><published>2008-04-17T04:56:00.000+05:30</published><updated>2008-04-17T04:56:00.000+05:30</updated><title type='text'>Not exactly faster, but another approach is to ite...</title><content type='html'>Not exactly faster, but another approach is to iterate through the ObjectSpace collection, and instantiate the matching class:&lt;BR/&gt;&lt;BR/&gt;require 'my_package/my_class'&lt;BR/&gt;&lt;BR/&gt;class Factory&lt;BR/&gt;   def self.get_object(o)&lt;BR/&gt;      ObjectSpace.each_object(Class) do |c|&lt;BR/&gt;         return c.new() if c.name.eql?(o)&lt;BR/&gt;      end&lt;BR/&gt;      return nil&lt;BR/&gt;   end&lt;BR/&gt;end&lt;BR/&gt;&lt;BR/&gt;#usage&lt;BR/&gt;require 'factory'&lt;BR/&gt;o = Factory.get_object("MyPackage::MyClass")</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/8713895322732366768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/8713895322732366768'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html?showComment=1208388360000#c8713895322732366768' title=''/><author><name>ngeren</name><uri>http://www.blogger.com/profile/03017211122191024916</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-277306284681829738' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/277306284681829738' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1043614743'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-4744553796281832837</id><published>2008-02-07T07:38:00.000+05:30</published><updated>2008-02-07T07:38:00.000+05:30</updated><title type='text'>I've been experimenting with JRuby and found that ...</title><content type='html'>I've been experimenting with JRuby and found that using const_get is just unreliable, while eval works fine.  For example, a java class com.foo.bar.Baz is represented as Java::FooBar::Baz. If you do const_get on Java::FooBar, you get a string "Java::FooBarConst_get". It appears that these Java package modules must define method_missing to just concatenate the method name to the module name. I haven't  investigated further.&lt;BR/&gt;&lt;BR/&gt;Anyway, using eval works fine.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/4744553796281832837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/277306284681829738/comments/default/4744553796281832837'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html?showComment=1202350080000#c4744553796281832837' title=''/><author><name>Dean</name><uri>http://www.blogger.com/profile/02505288380679936730</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-277306284681829738' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/277306284681829738' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1615133912'/></entry></feed>
