blib/lib/Net/MyIP.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 9 | 12 | 75.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 3 | 5 | 60.0 |
pod | 0 | 2 | 0.0 |
total | 12 | 19 | 63.1 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Net::MyIP; | ||||||
2 | |||||||
3 | our $VERSION = '0.01'; | ||||||
4 | |||||||
5 | 1 | 1 | 69519 | use utf8; | |||
1 | 15 | ||||||
1 | 5 | ||||||
6 | 1 | 1 | 692 | use JSON::XS; | |||
1 | 7391 | ||||||
1 | 64 | ||||||
7 | 1 | 1 | 448 | use LWP::Simple qw(get); | |||
1 | 67142 | ||||||
1 | 9 | ||||||
8 | |||||||
9 | sub new { | ||||||
10 | 0 | 0 | 0 | my $class = shift; | |||
11 | 0 | return bless {}, $class; | |||||
12 | } | ||||||
13 | |||||||
14 | sub myip { | ||||||
15 | 0 | 0 | 0 | return decode_json(get('https://api.myip.com')); | |||
16 | } | ||||||
17 | |||||||
18 | 1; | ||||||
19 | __END__ |