File: StringFact.pm

package info (click to toggle)
libmetabase-fact-perl 0.025-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 360 kB
  • sloc: perl: 1,076; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 444 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package Test::Metabase::StringFact;
use 5.006;
use strict;
use warnings;
use Metabase::Fact::String;
our @ISA = qw/Metabase::Fact::String/;

sub content_metadata {
    my $self = shift;
    return { 'size' => [ '//num' => length $self->content ], };
}

sub validate_content {
    my $self = shift;
    $self->SUPER::validate_content;
    die __PACKAGE__ . " content length must be greater than zero\n"
      if length $self->content < 0;
}

1;