| 1 | package SNMP::Insight::Meta::Attribute::Trait::MIBEntry; | ||
| 2 | |||
| 3 | #ABSTRACT: Attribute trait for attributes derived from MIBs | ||
| 4 | |||
| 5 | 5 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 5 | ▶ | use Moose::Util::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 5 | our $VERSION = '0.002'; #TRIAL VERSION: | |
| 9 | |||
| 10 | 5 | Moose::Util::meta_attribute_alias('MIBEntry'); | |
| 11 | |||
| 12 | 5 | enum 'MIBEntryType', [qw(scalar table column)]; | |
| 13 | |||
| 14 | 5 | has oid => ( | |
| 15 | is => 'rw', | ||
| 16 | isa => 'Str', | ||
| 17 | required => 1, | ||
| 18 | predicate => 'has_oid', | ||
| 19 | ); | ||
| 20 | |||
| 21 | 5 | has munger => ( | |
| 22 | is => 'rw', | ||
| 23 | isa => 'CodeRef', | ||
| 24 | required => 0, | ||
| 25 | predicate => 'has_munger', | ||
| 26 | ); | ||
| 27 | |||
| 28 | 5 | has entry_type => ( | |
| 29 | is => 'rw', | ||
| 30 | isa => 'MIBEntryType', | ||
| 31 | required => 1, | ||
| 32 | ); | ||
| 33 | |||
| 34 | 0 | ▶ | sub is_scalar { |
|
Subroutine
is_scalar: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 35 | 0 | return $_[0]->entry_type eq 'scalar'; | |
| 36 | } | ||
| 37 | |||
| 38 | 0 | ▶ | sub is_table { |
|
Subroutine
is_table: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 39 | 0 | return $_[0]->entry_type eq 'table'; | |
| 40 | } | ||
| 41 | |||
| 42 | 0 | ▶ | sub is_column { |
|
Subroutine
is_column: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 43 | 0 | return $_[0]->entry_type eq 'column'; | |
| 44 | } | ||
| 45 | |||
| 46 | 5 | 1; | |
| 47 | |||
| 48 | # Local Variables: | ||
| 49 | # mode: cperl | ||
| 50 | # indent-tabs-mode: nil | ||
| 51 | # cperl-indent-level: 4 | ||
| 52 | # cperl-indent-parens-as-block: t | ||
| 53 | # End: | ||
| 54 | |||
| 55 | __END__ | ||