Babble::Processors - Processor collection for Babble


Babble documentation Contained in the Babble distribution.

Index


Code Index:

NAME

Top

Babble::Processors - Processor collection for Babble

DESCRIPTION

Top

Babble::Processors is a collection of processors for Babble. All of the processors herein are run by default, and cannot be turned off, unless one fiddles with a Babble objects internals.

However, the processors are documented here, so that if one does turn them off, may he be able to re-use any of these.

METHODS

Top

master()

Adds a master key to the item: the id key of the channel.

This is useful when one wants to link back to the original channel from each and every item.

image()

Adds an image key to the item: the feed image of the channel.

creator()

Sets the author of the item to the source's -id field, if the item does not have an author yet.

default()

This processor runs all of the others, in the specified order, after each other.

AUTHOR

Top

Gergely Nagy, algernon@bonehunter.rulez.org

Bugs should be reported at http://bugs.bonehunter.rulez.org/babble.

SEE ALSO

Top

Babble


Babble documentation Contained in the Babble distribution.
## Babble/Processors.pm
## Copyright (C) 2004 Gergely Nagy <algernon@bonehunter.rulez.org>
##
## This file is part of Babble.
##
## Babble is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 dated June, 1991.
##
## Babble is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
## for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

package Babble::Processors;

use strict;
use Date::Manip;

sub master {
	my ($item, $channel) = @_;

	$$item->{master} = $$channel->{id};
}

sub image {
	my ($item, $channel) = @_;

	$$item->{image} = $$channel->{image};
}

sub creator {
	my ($item, undef, $source) = @_;

	$$item->{author} = $$source->{-id} unless $$item->{author};
}

sub default {
	master (@_);
	creator (@_);
	image (@_);
}

1;

# arch-tag: 83496c69-815a-4f12-8465-a569c67d5609