| 1 | package Device::WallyHome::Sensor::Threshold; | ||
| 2 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use MooseX::AttributeShortcuts; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $VERSION = '0.21.3'; | |
| 7 | |||
| 8 | |||
| 9 | #== ATTRIBUTES ================================================================= | ||
| 10 | |||
| 11 | 1 | has 'name' => ( | |
| 12 | is => 'ro', | ||
| 13 | isa => 'Str', | ||
| 14 | required => 1, | ||
| 15 | writer => '_name', | ||
| 16 | ); | ||
| 17 | |||
| 18 | 1 | has 'min' => ( | |
| 19 | is => 'ro', | ||
| 20 | isa => 'Maybe[Num]', | ||
| 21 | required => 1, | ||
| 22 | writer => '_min', | ||
| 23 | ); | ||
| 24 | |||
| 25 | 1 | has 'max' => ( | |
| 26 | is => 'ro', | ||
| 27 | isa => 'Maybe[Num]', | ||
| 28 | required => 1, | ||
| 29 | writer => '_max', | ||
| 30 | ); | ||
| 31 | |||
| 32 | |||
| 33 | #== PUBLIC METHODS ============================================================= | ||
| 34 | |||
| 35 | 0 | ▶ | sub asArrayRef { |
|
Subroutine
asArrayRef: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 36 | 0 | my ($self) = @_; | |
| 37 | |||
| 38 | return [ | ||
| 39 | 0 | $self->min(), | |
| 40 | $self->max(), | ||
| 41 | ]; | ||
| 42 | } | ||
| 43 | |||
| 44 | 0 | ▶ | sub asHref { |
|
Subroutine
asHref: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 45 | 0 | my ($self) = @_; | |
| 46 | |||
| 47 | return { | ||
| 48 | 0 | min => $self->min(), | |
| 49 | max => $self->max(), | ||
| 50 | }; | ||
| 51 | } | ||
| 52 | |||
| 53 | |||
| 54 | 1 | __PACKAGE__->meta->make_immutable; | |
| 55 | |||
| 56 | 1 | 1; | |