[BACK]Return to OpenAMD.pm CVS log [TXT][DIR] Up to [local] / HOPE / Net-OpenAMD / lib / Net

Diff for /HOPE/Net-OpenAMD/lib/Net/OpenAMD.pm between version 1.7 and 1.8

version 1.7, 2010/06/27 04:11:22 version 1.8, 2010/06/27 04:23:27
Line 1 
Line 1 
 package Net::OpenAMD;  package Net::OpenAMD;
   
 # $AFresh1: OpenAMD.pm,v 1.6 2010/06/27 00:52:33 andrew Exp $  # $AFresh1: OpenAMD.pm,v 1.7 2010/06/27 03:11:22 andrew Exp $
   
 use warnings;  use warnings;
 use strict;  use strict;
Line 10 
Line 10 
   
 my $BASE_URL = 'https://api.hope.net/api/';  my $BASE_URL = 'https://api.hope.net/api/';
   
 use Class::Std::Utils;  use Scalar::Util qw( refaddr );
   *_ident = \&refaddr;
   
 use LWP::UserAgent;  use LWP::UserAgent;
 use URI;  use URI;
Line 23 
Line 24 
   
     sub new {      sub new {
         my ( $class, $options ) = @_;          my ( $class, $options ) = @_;
         my $self = bless anon_scalar(), $class;          my $self = bless do { \my $x }, $class;
         my $ident = ident($self);          my $ident = _ident($self);
   
         $options //= {};          $options //= {};
   
Line 40 
Line 41 
   
     sub get {      sub get {
         my ( $self, $action, $query ) = @_;          my ( $self, $action, $query ) = @_;
         my $ident = ident($self);          my $ident = _ident($self);
   
         my $uri = URI->new( $base_url_of{$ident} . '/' . $action );          my $uri = URI->new( $base_url_of{$ident} . '/' . $action );
         $uri->query($query);          $uri->query($query);
Line 63 
Line 64 
   
     sub DESTROY {      sub DESTROY {
         my ($self) = @_;          my ($self) = @_;
         my $ident = ident $self;          my $ident = _ident $self;
   
         foreach my $attr_ref (@attr_refs) {          foreach my $attr_ref (@attr_refs) {
             delete $attr_ref->{$ident};              delete $attr_ref->{$ident};
Line 76 
Line 77 
   
 1;    # Magic true value required at end of module  1;    # Magic true value required at end of module
 __END__  __END__
   
 =head1 NAME  =head1 NAME
   
 Net::OpenAMD - Perl interface to the OpenAMD API  Net::OpenAMD - Perl interface to the OpenAMD API

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>