| 1 | package WebService::Technorati::Author; | ||
| 2 | use strict; | ||
| 3 | use utf8; | ||
| 4 | |||
| 5 | use fields qw(firstname lastname username thumbnailpicture); | ||
| 6 | |||
| 7 | use WebService::Technorati::BaseTechnoratiObject; | ||
| 8 | use base 'WebService::Technorati::BaseTechnoratiObject'; | ||
| 9 | |||
| 10 | |||
| 11 | BEGIN { | ||
| 12 | use vars qw ($VERSION $DEBUG); | ||
| 13 | $VERSION = 0.04; | ||
| 14 | $DEBUG = 0; | ||
| 15 | } | ||
| 16 | |||
| 17 | =head2 getFirstname | ||
| 18 | |||
| 19 | Usage : getFirstname(); | ||
| 20 | Purpose : | ||
| 21 | Returns : a scalar string | ||
| 22 | Argument : none | ||
| 23 | Throws : none | ||
| 24 | Comments : | ||
| 25 | See Also : WebService::Technorati | ||
| 26 | |||
| 27 | =cut | ||
| 28 | |||
| 29 | =head2 setFirstname | ||
| 30 | |||
| 31 | Usage : setFirstname(string); | ||
| 32 | Purpose : | ||
| 33 | Returns : void | ||
| 34 | Argument : a scalar string | ||
| 35 | Throws : none | ||
| 36 | Comments : | ||
| 37 | See Also : WebService::Technorati | ||
| 38 | |||
| 39 | =cut | ||
| 40 | |||
| 41 | |||
| 42 | =head2 getLastname | ||
| 43 | |||
| 44 | Usage : getLastname(); | ||
| 45 | Purpose : | ||
| 46 | Returns : a scalar string | ||
| 47 | Argument : none | ||
| 48 | Throws : none | ||
| 49 | Comments : | ||
| 50 | See Also : WebService::Technorati | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | =head2 setLastname | ||
| 55 | |||
| 56 | Usage : setLastname(string); | ||
| 57 | Purpose : | ||
| 58 | Returns : void | ||
| 59 | Argument : a scalar string | ||
| 60 | Throws : none | ||
| 61 | Comments : | ||
| 62 | See Also : WebService::Technorati | ||
| 63 | |||
| 64 | =cut | ||
| 65 | |||
| 66 | |||
| 67 | =head2 getUsername | ||
| 68 | |||
| 69 | Usage : getUsername(); | ||
| 70 | Purpose : | ||
| 71 | Returns : a scalar string | ||
| 72 | Argument : none | ||
| 73 | Throws : none | ||
| 74 | Comments : | ||
| 75 | See Also : WebService::Technorati | ||
| 76 | |||
| 77 | =cut | ||
| 78 | |||
| 79 | =head2 setUsername | ||
| 80 | |||
| 81 | Usage : setUsername(string); | ||
| 82 | Purpose : | ||
| 83 | Returns : void | ||
| 84 | Argument : a scalar string | ||
| 85 | Throws : none | ||
| 86 | Comments : | ||
| 87 | See Also : WebService::Technorati | ||
| 88 | |||
| 89 | =cut | ||
| 90 | |||
| 91 | |||
| 92 | =head2 getThumbnailpicture | ||
| 93 | |||
| 94 | Usage : getThumbnailpicture(); | ||
| 95 | Purpose : | ||
| 96 | Returns : a scalar string | ||
| 97 | Argument : none | ||
| 98 | Throws : none | ||
| 99 | Comments : | ||
| 100 | See Also : WebService::Technorati | ||
| 101 | |||
| 102 | =cut | ||
| 103 | |||
| 104 | =head2 setThumbnailpicture | ||
| 105 | |||
| 106 | Usage : setThumbnailpicture(string); | ||
| 107 | Purpose : | ||
| 108 | Returns : void | ||
| 109 | Argument : a scalar string | ||
| 110 | Throws : none | ||
| 111 | Comments : | ||
| 112 | See Also : WebService::Technorati | ||
| 113 | |||
| 114 | =cut | ||
| 115 | |||
| 116 | { | ||
| 117 | my %_attrs = ( | ||
| 118 | firstname => undef, | ||
| 119 | lastname => undef, | ||
| 120 | username => undef, | ||
| 121 | thumbnailpicture => undef | ||
| 122 | ); | ||
| 123 | sub _accessible { | ||
| 124 | if ($DEBUG) { | ||
| 125 | print __PACKAGE__ . ": checking for attr [$_[1]]\n"; | ||
| 126 | } | ||
| 127 | return exists($_attrs{$_[1]}); | ||
| 128 | } | ||
| 129 | } | ||
| 130 | |||
| 131 | sub new_from_node { | ||
| 132 | my $class = shift; | ||
| 133 | my $node = shift; | ||
| 134 | my $data = { | ||
| 135 | firstname => $node->findvalue('firstname')->string_value(), | ||
| 136 | lastname => $node->findvalue('lastname')->string_value(), | ||
| 137 | username => $node->findvalue('username')->string_value(), | ||
| 138 | thumbnailpicture => $node->findvalue('thumbnailpicture')->string_value() | ||
| 139 | }; | ||
| 140 | my $self = bless ($data, ref ($class) || $class); | ||
| 141 | return $self; | ||
| 142 | } | ||
| 143 | |||
| 144 | 1; | ||
| 145 |