Docs, small fixes, find_method_by_name and the get_value/set_value abstraction for...
[gitmo/Class-MOP.git] / lib / Class / MOP / Method.pm
index 8b3c2b4..f3ae077 100644 (file)
@@ -8,7 +8,7 @@ use Carp         'confess';
 use Scalar::Util 'reftype', 'blessed';
 use B            'svref_2object';
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 # introspection
 
@@ -23,7 +23,7 @@ sub wrap {
     my $class = shift;
     my $code  = shift;
     ('CODE' eq (reftype($code) || ''))
-        || confess "You must supply a CODE reference to bless";
+        || confess "You must supply a CODE reference to bless, not (" . ($code || 'undef') . ")";
     bless $code => blessed($class) || $class;
 }
 
@@ -141,6 +141,12 @@ sub wrap {
        $method;  
 }
 
+sub get_original_method {
+       my $code = shift; 
+    $MODIFIERS{$code}->{orig} 
+        if exists $MODIFIERS{$code};
+}
+
 sub add_before_modifier {
        my $code     = shift;
        my $modifier = shift;
@@ -269,6 +275,8 @@ This simply blesses the C<&code> reference passed to it.
 
 This simply blesses the C<&code> reference passed to it.
 
+=item B<get_original_method>
+
 =back
 
 =head2 Modifiers
@@ -296,4 +304,5 @@ L<http://www.iinteractive.com>
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 
 
-=cut
\ No newline at end of file
+=cut
+