| 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.02'; | ||||||
| 4 | |||||||
| 5 | 1 | 1 | 67099 | use utf8; | |||
| 1 | 14 | ||||||
| 1 | 5 | ||||||
| 6 | 1 | 1 | 685 | use JSON::XS; | |||
| 1 | 7140 | ||||||
| 1 | 61 | ||||||
| 7 | 1 | 1 | 440 | use LWP::Simple qw(get); | |||
| 1 | 65646 | ||||||
| 1 | 22 | ||||||
| 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__ |