<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Meta Bates &#187; singleton</title>
	<atom:link href="http://www.metabates.com/tag/singleton/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.metabates.com</link>
	<description>The technical ramblings of Mark Bates.</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:25:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to use a non-singleton version of Configatron</title>
		<link>http://www.metabates.com/2008/11/20/how-to-use-a-non-singleton-version-of-configatron/</link>
		<comments>http://www.metabates.com/2008/11/20/how-to-use-a-non-singleton-version-of-configatron/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 12:20:24 +0000</pubDate>
		<dc:creator>Mark Bates</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[configatron]]></category>
		<category><![CDATA[singleton]]></category>

		<guid isPermaLink="false">http://www.mackframework.com/?p=198</guid>
		<description><![CDATA[Since Configatron has come out it&#8217;s become a pretty popular library, and because of that I&#8217;ve received several feature requests. Nothing wrong with that. I actually welcome that, because, let&#8217;s be honest, that&#8217;s how configatron will become even better. The biggest request I&#8217;ve received is from people who want to use Configatron, but they want [...]]]></description>
			<content:encoded><![CDATA[<p>Since Configatron has come out it&#8217;s become a pretty popular library, and because of that I&#8217;ve received several feature requests. Nothing wrong with that. I actually welcome that, because, let&#8217;s be honest, that&#8217;s how configatron will become even better.</p>
<p>The biggest request I&#8217;ve received is from people who want to use Configatron, but they want their own instance of it, and not the global singleton instance of it. Although, I personally don&#8217;t see why you would need that, I&#8217;m a big enough man to understand that just because I don&#8217;t need it, doesn&#8217;t mean others don&#8217;t.</p>
<p>Last night I was reviewing the code, because I was asked this question again, and in doing so I realized that power has been there all along. It&#8217;s actually very simple. When you make a call on <code>Kernel#configatron</code> it returns a singleton of the <code>Configatron</code> class, but after that all it does is return an instance of the <code>Configatron::Store</code> class. So if you want your own instance of Configatron, what you really want is an instance of the <code>Configatron::Store</code> class, which you can do like so:</p>
<p><script src="http://gist.github.com/27027.js"></script>Â </p>
<p>Well, there you go, I hope that helps. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.metabates.com/2008/11/20/how-to-use-a-non-singleton-version-of-configatron/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.611 seconds -->

