| 1 | package # private | ||||||||||||
| 2 | Net::COLOURlovers::Color; | ||||||||||||
| 3 | |||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 1 | ▶ | use JSON qw( from_json ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 0 | ▶ | sub color { | ||||||||||
|
Subroutine
color: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 10 | 0 | my ( $self, $color ) = @_; | |||||||||||
| 11 | |||||||||||||
| 12 | my $response = | ||||||||||||
| 13 | 0 | $self->{'ua'} | |||||||||||
| 14 | ->post("http://www.colourlovers.com/api/color/$color?format=json"); | ||||||||||||
| 15 | 0 | return ( from_json $response->content )->[0]; | |||||||||||
| 16 | } | ||||||||||||
| 17 | |||||||||||||
| 18 | 0 | ▶ | sub colors { | ||||||||||
|
Subroutine
colors: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 19 | 0 | my ( $self, $args, $url ) = @_; | |||||||||||
| 20 | |||||||||||||
| 21 | 0 | $args = Net::COLOURlovers::_build_parametres( | |||||||||||
| 22 | $args, | ||||||||||||
| 23 | [ | ||||||||||||
| 24 | qw( | ||||||||||||
| 25 | lover hueRange briRange keywords keywordExact orderCol sortBy | ||||||||||||
| 26 | numResults resultOffset | ||||||||||||
| 27 | ) | ||||||||||||
| 28 | ] | ||||||||||||
| 29 | ); | ||||||||||||
| 30 | |||||||||||||
| 31 | my $response = | ||||||||||||
| 32 | 0 | ▶ | $self->{'ua'} | ||||||||||
|
Condition0%0/2
$url || 'http://www.colourlovers.com/api/colors?format=json'
MC/DC0%0/1
$url || 'http://www.colourlovers.com/api/colors?format=json'
$url
Truth table0%0/2
A
A= $url
| |||||||||||||
| 33 | ->post( $url || 'http://www.colourlovers.com/api/colors?format=json', | ||||||||||||
| 34 | $args ); | ||||||||||||
| 35 | |||||||||||||
| 36 | 0 | return from_json $response->content; | |||||||||||
| 37 | } | ||||||||||||
| 38 | |||||||||||||
| 39 | 0 | ▶ | sub colors_new { | ||||||||||
|
Subroutine
colors_new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 40 | 0 | my ( $self, $args ) = @_; | |||||||||||
| 41 | 0 | return $self->colors( $args, | |||||||||||
| 42 | 'http://www.colourlovers.com/api/colors/new?format=json' ); | ||||||||||||
| 43 | } | ||||||||||||
| 44 | |||||||||||||
| 45 | 0 | ▶ | sub colors_top { | ||||||||||
|
Subroutine
colors_top: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 46 | 0 | my ( $self, $args ) = @_; | |||||||||||
| 47 | 0 | return $self->colors( $args, | |||||||||||
| 48 | 'http://www.colourlovers.com/api/colors/top?format=json' ); | ||||||||||||
| 49 | } | ||||||||||||
| 50 | |||||||||||||
| 51 | 0 | ▶ | sub color_random { | ||||||||||
|
Subroutine
color_random: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 52 | 0 | my ( $self, $args ) = @_; | |||||||||||
| 53 | return ( | ||||||||||||
| 54 | 0 | $self->colors( | |||||||||||
| 55 | {}, 'http://www.colourlovers.com/api/colors/random?format=json' | ||||||||||||
| 56 | ) | ||||||||||||
| 57 | )->[0]; | ||||||||||||
| 58 | } | ||||||||||||
| 59 | |||||||||||||
| 60 | 1 | 1; | |||||||||||
| 61 | |||||||||||||
| 62 | __END__ | ||||||||||||