[pmg-devel] [PATCH pmg-api 2/2] add new What Object 'Match Archive Filename'

Dominik Csapak d.csapak at proxmox.com
Thu Apr 16 09:21:54 CEST 2020



On 4/15/20 5:11 PM, Stoiko Ivanov wrote:
>> +
>> +sub new {
>> +    my ($type, $fname, $ogroup) = @_;
>> +
>> +    my $class = ref($type) || $type;
>> +
>> +    my $self = $class->SUPER::new($fname, $ogroup);
>> +
>> +    return $self;
>> +}
>> +
>> +sub load_attr {
>> +    my ($type, $ruledb, $id, $ogroup, $value) = @_;
>> +
>> +    my $class = ref($type) || $type;
>> +
>> +    my $obj = $class->SUPER::load_attr($ruledb, $id, $ogroup, $value);
>> +
>> +    return $obj;
>> +}
> I think (and a quick test seems to agree) that we could simply drop
> the 'new' and 'load_attr' methods (they fall back to the superclass, which
> also does the '$class' name mangling) ?

yeah thanks for checking that, also i can drop most other subs as well,
they are just the same as from MatchFilename (what_match/get/etc.)

i'll send a v2



More information about the pmg-devel mailing list