The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::JobLog::Log::Event - basically adds an end time to App::JobLog::Log::Line events

VERSION

version 1.016

DESCRIPTION

App::JobLog::Log::Event represents an interval in time from the log, providing accessors to all the information about this event. It is similar to App::JobLog::Log::Line, delegating to an instance of the latter for much functionality, but it contains additional methods to handle the properties of intervals of time as distinct from points.

METHODS

new

Basic constructor. Expects single App::JobLog::Log::Line argument. Can be called on instance or class.

clone

Create a duplicate of this event.

overlap

Expects two DateTime objects as arguments. Returns the portion of this event overlapping the interval so defined.

data

Returns App::JobLog::Log::Line object on which this event is based.

start

Start of event. Is lvalue method.

end

End of event. Is lvalue method.

tags

Tags of event (array reference). Is lvalue method.

exists_tag

Expects a list of tags. Returns true if event contains any of them.

all_tags

Expects a list of tags. Returns whether event contains all of them.

cmp

Used to sort events. E.g.,

 my @sorted_events = sort { $a->cmp($b) } @unsorted;

is_closed

Whether an end moment for this event is defined.

is_open

Whether no end moment for this event is defined.

duration

Duration of event in seconds.

split_days

Splits a multi-day event up at the day boundaries.

intersects

Whether the time period of this overlaps with another.

AUTHOR

David F. Houghton <dfhoughton@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by David F. Houghton.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.