何らかの理由で、境界オブジェクトの子メソッドにアクセスできません。私はまだperlとの継承、特に祝福の部分について少し混乱しているので、可能な限り詳細に答えていただければ幸いです。また、建設的な批判は全体的なデザインについて素晴らしいでしょう。
Generic.pm(基本クラス)
package AccessList::Generic;
use strict;
use warnings;
sub new {
my $class = shift;
my $self = {
rules => [],
@_
};
bless $self, $class;
return $self;
}
sub get_line_count {
my $self = shift;
return scalar @{$self->{rules}};
}
1;
Extended.pm
package AccessList::Extended;
use strict;
use warnings;
use AccessList::Generic;
use base qw(AccessList::Generic);
sub new {
my ($class, @args) = @_;
my $self = $class->SUPER::new(@args);
return $self;
}
1;
Boundary.pm
package AccessList::Extended::Boundary;
use strict;
use warnings;
use AccessList::Extended;
use base qw(AccessList::Extended);
sub new {
my ($class, @args) = @_;
my $self = $class->SUPER::new(@args);
return $self;
}
sub get_acl_information {
my ($self) = @_;
return;
}
1;
失敗したテスト
can_ok('AccessList::Extended::Boundary', 'get_acl_information');
エラーメッセージ
# Failed test 'AccessList::Extended::Boundary->can('get_acl_information')'
# at t/b1.t line 42.
# AccessList::Extended::Boundary->can('get_acl_information') failed
# Looks like you failed 1 test of 2.