<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,7 +8,7 @@ require 'spec/rake/spectask'
 
 desc &quot;Run specs&quot;
 Spec::Rake::SpecTask.new do |t|
-  t.spec_opts = %w(-f specdoc)
+  t.spec_opts = %w(-f specdoc -c)
 end
 
 desc &quot;Run specs with Heckle&quot;</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -25,6 +25,14 @@ module Restflection
       name.titleize
     end
 
+    def instance_variable_name
+      &quot;@#{name}&quot;
+    end
+
+    def klass
+      name.singularize.classify.constantize
+    end
+
     URL_HELPER_FORMAT = /(?:hash_for_formatted|hash_for|formatted)_/
     URL_HELPER_ACTION = /.*?_/
     URL_HELPER_SUFFIX = /url|path/
@@ -32,14 +40,14 @@ module Restflection
     URL_HELPER = /\A(#{URL_HELPER_FORMAT})?(#{URL_HELPER_ACTION})?(#{URL_HELPER_SUFFIX})\Z/
     
     def method_missing(method_name, *args)
-      parts = []
-      3.times { |i| parts &lt;&lt; method_name.to_s.sub(URL_HELPER, &quot;\\#{i + 1}&quot;) }
-      url_helper = parts[0] + name_prefix + parts[1] + name + &quot;_&quot; + parts[2]
-      @controller.send(url_helper, *args)
-    end
-
-    def instance_variable_name
-      &quot;@#{name}&quot;
+      if method_name.to_s =~ URL_HELPER
+        parts = []
+        3.times { |i| parts &lt;&lt; method_name.to_s.sub(URL_HELPER, &quot;\\#{i + 1}&quot;) }
+        url_helper = parts[0] + name_prefix + parts[1] + name + &quot;_&quot; + parts[2]
+        @controller.send(url_helper, *args)
+      else
+        raise NoMethodError.new(&quot;undefined method '#{method_name}'&quot;, method_name, args)
+      end
     end
     
   end</diff>
      <filename>lib/restflection/resource_reflection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,8 @@
 require File.dirname(__FILE__) + &quot;/../spec_helper&quot;
 
+Speaker = Class.new
+Account = Class.new
+
 module Restflection
   
   describe ResourceReflection, &quot;with a name of 'account' and an unspecified name prefix&quot; do
@@ -47,6 +50,16 @@ module Restflection
       @controller.expects(:formatted_new_account_path)
       @reflection.formatted_new_path
     end
+
+    it &quot;should automatically pass the resource to member methods&quot;
+
+    it &quot;should raise a NoMethodError if the method does not match&quot; do
+      lambda { @reflection.every_man_is_an_island }.should raise_error(NoMethodError, &quot;undefined method 'every_man_is_an_island'&quot;)
+    end
+
+    it &quot;should return Account when asked for klass&quot; do
+      @reflection.klass.should == Account
+    end
     
   end
 
@@ -92,5 +105,19 @@ module Restflection
     end
   
   end
+
+  describe ResourceReflection, &quot;with a name of 'speakers'&quot; do
+
+    include SharedStubs
+
+    before do
+      @reflection = ResourceReflection.new(controller_stub, &quot;speakers&quot;)
+    end
+
+    it &quot;should return Speaker when asked for klass&quot; do
+      @reflection.klass.should == Speaker
+    end
+  
+  end
   
 end</diff>
      <filename>spec/restflection/resource_reflection_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>24b6de5fcb1b360deca29955af036c0a13bd7db2</id>
    </parent>
  </parents>
  <author>
    <name>Jon Leighton</name>
    <email>j@jonathanleighton.com</email>
  </author>
  <url>http://github.com/jonleighton/restflection/commit/d35e15d2713f74a3aac60a264f89f471232ef0eb</url>
  <id>d35e15d2713f74a3aac60a264f89f471232ef0eb</id>
  <committed-date>2007-05-31T16:05:40-07:00</committed-date>
  <authored-date>2007-05-31T16:05:40-07:00</authored-date>
  <message>Raise NoMethodError if the method doesn't match, allow klass to be asked for</message>
  <tree>b9982f54d4ccc3f0e08666881465fde80187f0e1</tree>
  <committer>
    <name>Jon Leighton</name>
    <email>j@jonathanleighton.com</email>
  </committer>
</commit>
