| 1 | # | ||||||||||
| 2 | # This file is part of Redmine-API | ||||||||||
| 3 | # | ||||||||||
| 4 | # This software is copyright (c) 2014 by celogeek <me@celogeek.com>. | ||||||||||
| 5 | # | ||||||||||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||||||||||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||||||||||
| 8 | # | ||||||||||
| 9 | package Redmine::API; | ||||||||||
| 10 | |||||||||||
| 11 | # ABSTRACT: Communicate with Redmine thought the API | ||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 1 | our $VERSION = '0.04'; # VERSION | |||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 1 | ▶ | use Redmine::API::Request; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | |||||||||||
| 20 | 1 | ▶ | use vars qw/$AUTOLOAD/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: not called CC=2 SCAR=17.9
| |||||||||||
| 23 | 0 | my $self = shift; | |||||||||
| 24 | 0 | my $route = substr( $AUTOLOAD, length(__PACKAGE__) + 2 ); | |||||||||
| 25 | 0 | ▶ | return if $route eq 'DESTROY'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 0 | return Redmine::API::Request->new( api => $self, route => $route ); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 1 | has 'auth_key' => ( | |||||||||
| 30 | is => 'ro', | ||||||||||
| 31 | required => 1, | ||||||||||
| 32 | ); | ||||||||||
| 33 | |||||||||||
| 34 | 1 | has 'base_url' => ( | |||||||||
| 35 | is => 'ro', | ||||||||||
| 36 | required => 1, | ||||||||||
| 37 | ); | ||||||||||
| 38 | |||||||||||
| 39 | has 'trace' => ( | ||||||||||
| 40 | is => 'ro', | ||||||||||
| 41 | 0 | ▶ | default => sub {0}, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 42 | 1 | ); | |||||||||
| 43 | |||||||||||
| 44 | 1 | 1; | |||||||||
| 45 | |||||||||||
| 46 | __END__ | ||||||||||