Moose/Connection/WWW.pm

filter: Statementstmt 77.1% 27 / 35 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 8 / 10 Podpod 0.0% 0 / 2 totaltotal 74.4% 35 / 47 CC 1 SCAR 1.8
CC
1
Cov
77%
Read
2.0
Write
2.0
BEGIN
1.0
CRAP 1.2
« Moose/Instrument/Keysight34470A.pm ↑ Summary Moose/Instrument/SCPI/Sense/Protection.pm »
1 package Lab::Moose::Connection::WWW;
2 1 $Lab::Moose::Connection::WWW::VERSION = '3.931';
3 #ABSTRACT: Connection with URL requests
4  
5 1 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Moose::Util::TypeConstraints qw(enum);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Lab::Moose::Instrument qw/timeout_param read_length_param/;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use LWP::Simple;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19  
20 1 has ip => (
21 is => 'ro',
22 isa => 'Str',
23 required => 1,
24 );
25  
26 1 has port => (
27 is => 'ro',
28 isa => 'Lab::Moose::PosNum',
29 required => 1,
30 );
31  
32 0 ▶sub Read {
Subroutine Read: not called CC=1 SCAR=6.9
Pod undocumented
33 0 my ( $self, %args ) = validated_hash(
34 \@_,
35 command => { isa => 'Str' },
36 );
37 0 my $command = $args{'command'};
38 0 my $url = "http://$self->ip():$self->port()$command";
39 0 return get( $url );
40 }
41  
42 0 ▶sub Write {
Subroutine Write: not called CC=1 SCAR=6.9
Pod undocumented
43 0 my ( $self, %args ) = validated_hash(
44 \@_,
45 command => { isa => 'Str' },
46 );
47 0 my $command = $args{'command'};
48 0 my $url = "http://$self->ip():$self->port()$command";
49 0 get( $url );
50 }
51  
52 1 1;
53  
54 __END__
« Moose/Instrument/Keysight34470A.pm ↑ Summary Moose/Instrument/SCPI/Sense/Protection.pm »