Clair::Polisci

Speaker


SummaryPackage variablesSynopsisDescriptionGeneral documentationMethods

SummaryTop
Clair::Polisci::Speaker - An object representing a hansard speaker

Package variablesTop
No package variables defined.

SynopsisTop
    my $speaker = Clair::Polisci::Speaker->new(
source => "polisci_us",
id => 49238
);

DescriptionTop
This is a Speaker object used to represent a generic speaker from a hansard.
It is basically a container object with a source, an id and an equality
relation. Two Speakers are equal if they come from the same source and have
the same id.

MethodsTop
equalsNo descriptionCode
newDescriptionCode

Methods description


newcode    nextTop
    
my $speaker = Clair::Polisci::Speaker->new(
source => "some_db",
id => 49032
);
Constructs a new speaker from the given source and id. Additional properties
can be given to the speaker by adding them to the constructor's parameter
list.

Methods code


equalsdescriptionprevnextTop
sub equals {
    my $self = shift;
    my $other_speaker = shift;

    return ($self->{source} eq $other_speaker->{source}) 
        && ($self->{id} eq $other_speaker->{id});
}

newdescriptionprevnextTop
sub new {
    my $self = shift;
    my %args = @_;
    die "Speaker source must be defined" unless defined $args{source};
    die "Speaker id must be defined" unless defined $args{id};
    $self =\% args;
    return bless($self);
}

General documentation


AUTHORTop
Tony Fader afader@umich.edu