NAME

OpenGbg::Service::Bridge::BridgeOpening - A change in status for Göta Älvbron

SYNOPSIS

my $bridge = OpenGbg->new->bridge;
my $status = $bridge->get_opened_status->get_by_index(2);

printf 'it was %s', $status->was_open ? 'open' : 'closed';

DESCRIPTIOn

Each BridgeOpening object only knows if the bridge was opened or closed at that time. Usually, an 'open' BridgeOpening is followed a few minutes later by a 'closed' one.

ATTRIBUTES

timestamp

A DateTime object.

The time the bridge was either open or closed.

was_open

Boolean. True if the bridge was open at timestamp, false if not.

AUTHOR

Erik Carlsson <info@code301.com>

COPYRIGHT

Copyright 2014 - Erik Carlsson

LICENSE

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