OurCal::Event - an event class for OurCal


OurCal documentation Contained in the OurCal distribution.

Index


Code Index:

NAME

Top

OurCal::Event - an event class for OurCal

METHODS

Top

new <param[s]>

Requires a description and a date (in yyyy-mm-dd form.

Can also take id, recurring (boolean) and editable (boolean) params.

description

The description of the event

date

The date of the event in yyy-mm-dd form.

id

The id of the event (may return undef).

recurring

Is the event recurring

editable

Is this event editable.


OurCal documentation Contained in the OurCal distribution.
package OurCal::Event;


use strict;

sub new {
    my ($class, %event) = @_;
    return bless \%event, $class;   
}

                
sub description {
    my $self = shift;
    return $self->_trim($self->{description});
}
      

   
sub date {
	my $self = shift;
	return $self->{date};
}

                
sub id {
    my $self = shift;
    return $self->{id};
}

sub recurring {
    my $self = shift;
    return $self->{recurring} || 0;
}

sub editable {
    my $self = shift;
    return $self->{editable} || 0;
}


sub _trim {
    my($self, $text) = @_;
    $text =~ s/^\s*(.+=?)\$/$1/;
    return $text;
}

1;