<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -7,6 +7,34 @@ h2. Requirements and Installation
 * Install the hpricot gem  (gem install hpricot)
 * Install the cash_handler plugin  (script/plugin install git://github.com/JamesBrooks/cash_handler.git)
 
+h2. Usage
+
+&lt;pre&gt;&lt;code&gt;
+  c = CashHandler::Base.new
+  
+  # Get the current exchange rate of the AUD against the USD (currency code strings are case in-sensitive, can also be symbols)
+  c.get('AUD')
+  =&gt; 0.619099
+  
+  # Get the current exchange rate of the AUD against the GBP
+  c.get('AUD', :against =&gt; 'GBP')
+  =&gt; 0.418621272567449
+  
+  # Convert
+  c.convert(10, :aud, :usd)
+  =&gt; 6.19099
+  
+  # Force the converstion rates cache to reload currencies
+  c.cache.expire
+  
+  # The CashHandler::Cache has a default cache life of one day, this can be overridden in one of two ways
+  # Upon creation
+  c = CashHandler::Base.new(30.minutes)
+  
+  # During operation
+  c.cache.ttl = 30.minutes
+&lt;/code&gt;&lt;/pre&gt;
+
 h2. Copyright and License
 
 Copyright (c) 2008 James Brooks, released under the MIT license</diff>
      <filename>README.textile</filename>
    </modified>
    <modified>
      <diff>@@ -2,18 +2,19 @@ module CashHandler
   class Base
     attr_accessor :cache
     
-    def initialize
-      @cache = CashHandler::Cache.new
+    # Init the CashHandler (and cache), with a default TTL of 1 day
+    def initialize(ttl=1.day)
+      @cache = CashHandler::Cache.new(ttl)
     end
     
     # Fetches the exchange rate of a currency against the USD
-    def get(code)
-      @cache.get(code.to_s.upcase)
+    def get(code, options={:against =&gt; :usd})
+      @cache.get(code.to_s.upcase) / @cache.get(options[:against].to_s.upcase)
     end
     
     # Converts a value from one currency to another
     def convert(value, from, to)
-      value * get(from) / get(to)
+      value * get(from, :against =&gt; to)
     end
   end
 end</diff>
      <filename>lib/cash_handler/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,15 +5,15 @@ module CashHandler
     attr_accessor :ttl
     
     # Creates the cache with a default TTL (time to live) of 1 day. After this TTL has elapsed, cached values are refreshed
-    def initialize(ttl=1.day)
+    def initialize(ttl)
       @ttl = ttl
       @expires_at = ttl.from_now
       
-      expire_cache
+      expire
     end
     
     # Forces an expiry of the cache
-    def expire_cache
+    def expire
       @expires_at = ttl.from_now
       @rates = CashHandler::Parser.fetch_rates
     end
@@ -21,7 +21,7 @@ module CashHandler
     # Fetches a cached values (and refreshes the cache if it has expired)
     def get(code)
       # Ensure we have a collection of rates
-      expire_cache unless @rates &amp;&amp; @rates.any? &amp;&amp; @expires_at &gt; Time.now
+      expire unless @rates &amp;&amp; @rates.any? &amp;&amp; @expires_at &gt; Time.now
       
       if @rates[code]
         @rates[code]</diff>
      <filename>lib/cash_handler/cache.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b1186d15f91552648e4ddcf3451164a0f1e78f0e</id>
    </parent>
  </parents>
  <author>
    <name>James Brooks</name>
    <email>james@gooddogdesign.com</email>
  </author>
  <url>http://github.com/JamesBrooks/cash_handler/commit/5c65f27e79b4d18130f65556e3c4d78936ca9448</url>
  <id>5c65f27e79b4d18130f65556e3c4d78936ca9448</id>
  <committed-date>2008-11-20T16:29:55-08:00</committed-date>
  <authored-date>2008-11-20T16:29:55-08:00</authored-date>
  <message>Added fetching exchange rates as values against rates other than the USD. Made changing the cache TTL easier (during creation)</message>
  <tree>7cd5ce2fa64abe96b4c542fb6745948b2654d86b</tree>
  <committer>
    <name>James Brooks</name>
    <email>james@gooddogdesign.com</email>
  </committer>
</commit>
