use Scalar::Util 'reftype', 'blessed';
use B 'svref_2object';
-our $VERSION = '0.02';
+our $VERSION = '0.03';
# introspection
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;
}
$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;
This simply blesses the C<&code> reference passed to it.
+=item B<get_original_method>
+
=back
=head2 Modifiers
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
+