root/branches/feature-server/plagger/lib/Plagger/Thing.pm

Revision 307 (checked in by miyagawa, 3 years ago)
  • Added clone, clear_entries to $feed
  • Added source to $entry, if it's copied to SmartFeed?
  • Property svn:keywords set to Id Revision
Line 
1 package Plagger::Thing;
2 use strict;
3 use base qw( Class::Accessor::Fast );
4
5 sub has_tag {
6     my($self, $want_tag) = @_;
7     for my $tag (@{$self->tags}) {
8         return 1 if $tag eq $want_tag;
9     }
10     return 0;
11 }
12
13 sub add_tag {
14     my($self, $tag) = @_;
15     push @{$self->tags}, $tag
16         unless $self->has_tag($tag);
17 }
18
19 sub clone {
20     my $self = shift;
21     my $clone = Storable::dclone($self);
22     $clone;
23 }
24
25 1;
Note: See TracBrowser for help on using the browser.