Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / DateTime / TimeZone / Floating.pm
1 package DateTime::TimeZone::Floating;
2
3 use strict;
4
5 use vars qw ($VERSION @ISA);
6 $VERSION = 0.01;
7
8 use DateTime::TimeZone;
9 use base 'DateTime::TimeZone::OffsetOnly';
10
11 sub new
12 {
13     my $class = shift;
14
15     return bless { name => 'floating',
16                    offset => 0 }, $class;
17 }
18
19 sub is_floating { 1 }
20
21 sub STORABLE_thaw
22 {
23     my $self = shift;
24     my $cloning = shift;
25     my $serialized = shift;
26
27     my $class = ref $self || $self;
28
29     my $obj;
30     if ( $class->isa(__PACKAGE__) )
31     {
32         $obj = __PACKAGE__->new();
33     }
34     else
35     {
36         $obj = $class->new();
37     }
38
39     %$self = %$obj;
40
41     return $self;
42 }
43
44
45 __END__
46
47 =head1 NAME
48
49 DateTime::TimeZone::Floating - A time zone that is always local
50
51 =head1 SYNOPSIS
52
53   my $floating_tz = DateTime::TimeZone::Floating->new;
54
55 =head1 DESCRIPTION
56
57 This class is used to provide the DateTime::TimeZone API needed by
58 DateTime.pm, but for floating times, as defined by the RFC 2445 spec.
59 A floating time has no time zone, and has an effective offset of zero.
60
61 =head1 USAGE
62
63 This class has the same methods as a real time zone object, but the
64 C<short_name_for_datetime()>, and C<category()> methods both return
65 undef.
66
67 =head1 AUTHOR
68
69 Dave Rolsky, <autarch@urth.org>
70
71 =head1 COPYRIGHT & LICENSE
72
73 Copyright (c) 2003-2008 David Rolsky.  All rights reserved.  This
74 program is free software; you can redistribute it and/or modify it
75 under the same terms as Perl itself.
76
77 The full text of the license can be found in the LICENSE file included
78 with this module.
79
80 =cut