X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FRelationship.pm;h=54962cd518a92cd21136f036396730ce16e54e1d;hb=51ec03826afb5b20a686a7303bc55c42f4715945;hp=880ffc2d453f19ff07c5c6edc43b777ecacd59a6;hpb=ddc0a6c89d212433eb5716b2aa963f63b1f348d1;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/CDBICompat/Relationship.pm b/lib/DBIx/Class/CDBICompat/Relationship.pm index 880ffc2..54962cd 100644 --- a/lib/DBIx/Class/CDBICompat/Relationship.pm +++ b/lib/DBIx/Class/CDBICompat/Relationship.pm @@ -3,11 +3,15 @@ package use strict; use warnings; -use Sub::Name (); + +use base 'DBIx::Class'; + +use DBIx::Class::_Util 'quote_sub'; +use namespace::clean; =head1 NAME -DBIx::Class::CDBICompat::Relationship +DBIx::Class::CDBICompat::Relationship - Emulate the Class::DBI::Relationship object returned from meta_info() =head1 DESCRIPTION @@ -23,20 +27,26 @@ my %method2key = ( args => 'args', ); +quote_sub __PACKAGE__ . "::$_" => "\$_[0]->{$method2key{$_}}" + for keys %method2key; + sub new { my($class, $args) = @_; - + return bless $args, $class; } -for my $method (keys %method2key) { - my $key = $method2key{$method}; - my $code = sub { - $_[0]->{$key}; - }; - - no strict 'refs'; - *{$method} = Sub::Name::subname $method, $code; -} +=head1 FURTHER QUESTIONS? + +Check the list of L. + +=head1 COPYRIGHT AND LICENSE + +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L. + +=cut 1;