<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -107,8 +107,14 @@ class Xurrency
       return @cache[name][args]
     end
     klass.__send__(:define_method, &quot;update_#{name}&quot;) do |*args|
-      @cache[name][args] = nil
+      @cache[name].delete(args)
       __send__(name, *args)
     end
+    klass.__send__(:define_method, &quot;#{name}_cached?&quot;) do |*args|
+      @cache[name].has_key?(args)
+    end
+    klass.__send__(:define_method, &quot;clear_#{name}&quot;) do |*args|
+      @cache[name].delete(args)
+    end
   end
 end</diff>
      <filename>lib/xurrency.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,18 +19,31 @@ describe &quot;Xurrency&quot; do
     res.__id__.should.not == $xu.update_zone(&quot;jpy&quot;).__id__
   end
 
+  it &quot;should know weather cached or not&quot; do
+    $xu.zone_cached?(&quot;cny&quot;).should.be.false
+    $xu.zone(&quot;cny&quot;)
+    $xu.zone_cached?(&quot;cny&quot;).should.be.true
+  end
+
+  it &quot;should clear cache&quot; do
+    $xu.zone(&quot;usd&quot;)
+    $xu.zone_cached?(&quot;usd&quot;).should.be.true
+    $xu.clear_zone(&quot;usd&quot;)
+    $xu.zone_cached?(&quot;usd&quot;).should.be.false
+  end
+
   it &quot;should respond methods&quot; do
-    [&quot;currency_name&quot;,
-     &quot;zone&quot;,
-     &quot;url&quot;,
-     &quot;currencies&quot;,
-     &quot;values&quot;,
-     &quot;values_inverse&quot;,
-     &quot;update_currency_name&quot;,
-     &quot;update_zone&quot;,
-     &quot;update_url&quot;,
-     &quot;update_currencies&quot;,
-     &quot;update_values&quot;,
-     &quot;update_values_inverse&quot;].each {|name| $xu.methods.should.include? name }
+    methods = []
+    list = [ &quot;currency_name&quot;,
+             &quot;zone&quot;,
+             &quot;url&quot;,
+             &quot;currencies&quot;,
+             &quot;values&quot;,
+             &quot;values_inverse&quot; ]
+    methods += list
+    methods += list.map {|name| &quot;update_#{name}&quot; }
+    methods += list.map {|name| &quot;clear_#{name}&quot; }
+    methods += list.map {|name| &quot;#{name}_cached?&quot; }
+    methods.each {|name| $xu.methods.should.include? name }
   end
 end</diff>
      <filename>spec/xurrency_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ace66b474f8197761cb242b5da6c18d0f2568605</id>
    </parent>
  </parents>
  <author>
    <name>Keita Yamaguchi</name>
    <email>keita.yamaguchi@gmail.com</email>
  </author>
  <url>http://github.com/keita/ruby-xurrency/commit/5916217d2c83fb36262593dcbdc955cc8c4c4d0f</url>
  <id>5916217d2c83fb36262593dcbdc955cc8c4c4d0f</id>
  <committed-date>2008-04-18T22:24:01-07:00</committed-date>
  <authored-date>2008-04-18T22:24:01-07:00</authored-date>
  <message>Added new method 'clear_*' and '*_cached?'</message>
  <tree>318d1d3c2fbae135e2c1560881e287827c6b82a5</tree>
  <committer>
    <name>Keita Yamaguchi</name>
    <email>keita.yamaguchi@gmail.com</email>
  </committer>
</commit>
