| OurCal documentation | Contained in the OurCal distribution. |
OurCal::Event - an event class for OurCal
Requires a description and a date (in yyyy-mm-dd form.
Can also take id, recurring (boolean) and editable (boolean) params.
The description of the event
The date of the event in yyy-mm-dd form.
The id of the event (may return undef).
Is the event recurring
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;