| 1 | package WebService::TeamCity::Entity::HasStatus; | ||
| 2 | |||
| 3 | 4 | ▶ | use v5.10; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 4 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 4 | our $VERSION = '0.04'; | |
| 9 | |||
| 10 | 4 | ▶ | use Types::Standard qw( Bool ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 4 | ▶ | use WebService::TeamCity::Types qw( JSONBool ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 4 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 4 | requires 'status'; | |
| 16 | |||
| 17 | has passed => ( | ||
| 18 | is => 'ro', | ||
| 19 | isa => Bool | JSONBool, | ||
| 20 | lazy => 1, | ||
| 21 | 2 | ▶ | default => sub { $_[0]->status eq 'SUCCESS' }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 22 | 4 | ); | |
| 23 | |||
| 24 | has failed => ( | ||
| 25 | is => 'ro', | ||
| 26 | isa => Bool | JSONBool, | ||
| 27 | lazy => 1, | ||
| 28 | 2 | ▶ | default => sub { $_[0]->status eq 'FAILURE' }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 29 | 4 | ); | |
| 30 | |||
| 31 | 4 | 1; | |
| 32 | |||
| 33 | # ABSTRACT: Role for any REST API object with a status | ||
| 34 | |||
| 35 | __END__ | ||