Evernote/Tag.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 46 CC 3 SCAR 14.6
CC
3
Cov
0%
new
6.0
AUTOLOAD
6.0
delete
2.0
CRAP 4.3
1 package Net::Evernote::Tag;
2  
3 use strict;
4 use warnings;
5 our $VERSION = '0.07';
6  
7 sub new {
8 my ($class, $args) = @_;
9 my $debug = $ENV{DEBUG};
10  
11 if (!$$args{_obj} && !$$args{name} && !$$args{guid}) {
12 die "Name or Guid required to create/retrieve a tag\n";
13 }
14  
15 my $obj = $$args{_obj};
16  
17 return bless {
18 _obj => $obj,
19 _authentication_token => $$args{_authentication_token},
20 debug => $debug,
21 _notestore => $$args{_notestore},
22 }, $class;
23 }
24  
25 sub delete {
26 my ($self, $args) = @_;
27 my $guid = $self->guid;
28  
29 my $authToken = $self->{_authentication_token};
30 my $client = $self->{_notestore};
31  
32 return $client->expungeTag($authToken,$guid);
33 }
34  
35 # the magic
36 sub AUTOLOAD {
37 my ($self,@args) = @_;
38 our ($AUTOLOAD);
39 my $method = $AUTOLOAD;
40 $method =~ s/.*:://;
41  
42 if ($self->{_obj}->can($method)) {
43 return $self->{_obj}->$method;
44 } else {
45 return undef;
46 }
47 }
48 1;
49  
50  
51  
52 =head1 NAME
53  
54 Net::Evernote::Tag
55  
56 =head1 VERSION
57  
58 Version 0.06
59  
60  
61 =head1 SYNOPSIS
62  
63 use Net::Evernote;
64 use Net::Evernote::Tag;
65  
66 my $evernote = Net::Evernote->new({
67 authentication_token => $authentication_token
68 });
69  
70 my $tag = $evernote->createTag({'name' => $tag_name });
71 $tag_guid = $tag->guid;
72  
73 my $tag = $evernote->getTag({
74 guid => $tag_guid,
75 });
76  
77 my $note = $evernote->getNote({
78 guid => $note_guid,
79 });
80  
81 my $tagGuids = $note->tagGuids;
82  
83 =head1 SEE ALSO
84  
85 http://www.evernote.com/about/developer/api/
86  
87  
88 =head1 AUTHOR
89  
90 David Collins <davidcollins4481@gmail.com>
91  
92 =head1 BUGS/LIMITATIONS
93  
94 If you have found bugs, please send email to <davidcollins4481@gmail.com>
95  
96  
97 =head1 SUPPORT
98  
99 You can find documentation for this module with the perldoc command.
100  
101 perldoc Net::Evernote::Tag
102  
103  
104 =head1 COPYRIGHT & LICENSE
105  
106 Copyright 2013 David Collins, all rights reserved.
107  
108 This program is free software; you can redistribute it and/or modify
109 it under the same terms as Perl itself.