| 1 | package Games::EveOnline::EveCentral::Request::QuickLookPath; | ||
| 2 | { | ||
| 3 | 3 | $Games::EveOnline::EveCentral::Request::QuickLookPath::VERSION = '0.001'; | |
| 4 | } | ||
| 5 | |||
| 6 | |||
| 7 | # ABSTRACT: Create a request for the quicklookpath endpoint. | ||
| 8 | |||
| 9 | |||
| 10 | 3 | ▶ | use Moo 1.003001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 3 | ▶ | use MooX::Types::MooseLike 0.25; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 3 | ▶ | use MooX::StrictConstructor 0.006; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 3 | ▶ | use MooX::Types::MooseLike::Base qw(AnyOf ArrayRef HashRef Int Str); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 3 | ▶ | use 5.012; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | 3 | extends 'Games::EveOnline::EveCentral::Request'; | |
| 18 | |||
| 19 | 3 | ▶ | use Readonly 1.03; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | |||
| 22 | 3 | Readonly::Scalar my $ENDPOINT => 'quicklook/onpath'; | |
| 23 | |||
| 24 | |||
| 25 | 3 | has 'hours' => ( | |
| 26 | is => 'ro', | ||
| 27 | isa => Int, | ||
| 28 | default => 360 | ||
| 29 | ); | ||
| 30 | |||
| 31 | 3 | has 'type_id' => ( | |
| 32 | is => 'ro', | ||
| 33 | isa => Int, | ||
| 34 | required => 1 | ||
| 35 | ); | ||
| 36 | |||
| 37 | 3 | has 'min_q' => ( | |
| 38 | is => 'ro', | ||
| 39 | isa => Int, | ||
| 40 | default => 1 | ||
| 41 | ); | ||
| 42 | |||
| 43 | 3 | has 'from_system' => ( | |
| 44 | is => 'ro', | ||
| 45 | isa => AnyOf[Int, Str], | ||
| 46 | required => 1 | ||
| 47 | ); | ||
| 48 | |||
| 49 | 3 | has 'to_system' => ( | |
| 50 | is => 'ro', | ||
| 51 | isa => AnyOf[Int, Str], | ||
| 52 | required => 1 | ||
| 53 | ); | ||
| 54 | |||
| 55 | 3 | has '_path' => ( | |
| 56 | is => 'lazy', | ||
| 57 | isa => Str, | ||
| 58 | ); | ||
| 59 | |||
| 60 | 3 | has '_content' => ( | |
| 61 | is => 'lazy', | ||
| 62 | isa => ArrayRef[Str] | ||
| 63 | ); | ||
| 64 | |||
| 65 | |||
| 66 | |||
| 67 | 2 | ▶ | sub request { |
|
Subroutine
request: called CC=1 SCAR=0.0
Pod
documented
| |||
| 68 | 2 | my $self = shift; | |
| 69 | 2 | my $path = $self->_path; | |
| 70 | 2 | my $content = $self->_content; | |
| 71 | |||
| 72 | 2 | return $self->http_request($path, $content); | |
| 73 | } | ||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | 3 | ▶ | sub _build__path { |
|
Subroutine
_build__path: called CC=1 SCAR=0.0
| |||
| 78 | 3 | my $self = shift; | |
| 79 | |||
| 80 | 3 | my $path = $ENDPOINT . '/'; | |
| 81 | |||
| 82 | 3 | $path .= 'from/' . $self->from_system . '/' . | |
| 83 | 'to/' . $self->to_system . '/' . | ||
| 84 | 'fortype/' . $self->type_id; | ||
| 85 | |||
| 86 | 3 | return $path; | |
| 87 | } | ||
| 88 | |||
| 89 | 3 | ▶ | sub _build__content { |
|
Subroutine
_build__content: called CC=1 SCAR=0.0
| |||
| 90 | 3 | my $self = shift; | |
| 91 | |||
| 92 | 3 | my @content; | |
| 93 | 3 | push @content, 'sethours', $self->hours; | |
| 94 | 3 | push @content, 'setminQ', $self->min_q; | |
| 95 | |||
| 96 | 3 | return \@content; | |
| 97 | } | ||
| 98 | |||
| 99 | |||
| 100 | 3 | 1; # End of Games::EveOnline::EveCentral::Request::QuickLookPath | |
| 101 | |||
| 102 | __END__ | ||