Jed Lund > DateTimeX-Mashup-Shiras-v0.28.2 > DateTimeX::Mashup::Shiras::Types

Download:
DateTimeX-Mashup-Shiras-v0.28.2.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: v0.28.2   Source  

NAME ^

DateTimeX::Mashup::Shiras::Types - Types for DateTimeX::Mashup::Shiras

SYNOPSIS ^

    #!perl
    package MyPackage;

    use Moose;
    use DateTimeX::Mashup::Shiras::Types qw(
        weekday
    );
    
    has 'attribute_1' => (
            is  => 'ro',
            isa => weekday,
        );

DESCRIPTION ^

Shiras - A small subspecies of Moose found in the western United States (of America).

This is the custom type class that ships with the DateTimeX::Mashup::Shiras package. Wherever possible coersion failures are passed back to the type so type errors will be explained.

There are only subtypes in this package! WARNING These types should be considered in a beta state. Future type fixing will be done with a set of tests in the test suit of this package. (currently none are implemented)

See MooseX::Types for general re-use of this module.

Types ^

weekday

Definition: integers ( 1 .. 7 )

Coercions: from a string. The type will try to qr//i match the passed string to an english name of the week.

datetimedate

Definition: a DateTime instance

Coercions:

from a number This will check the number for 0, 60 (microsoft issues), negative integers, and positive integers with more than 7 digits and read them as epoch (Nixy) dates with the start at January 1st, 1970 using. DateTime::Format::Epoch It will turn any positive integer or decimial with less than 7 leading digits into an excel date using DateTime::Format::Excel. All positive decimals with 7 or more digits will also be treated as excel dates. Negative decimals will fail.

from a string This will use DateTime::Format::Flexible to try and coerce the string into a DateTime object.

from an array ref This will use the second element of the array ref to try to match 'epoch', 'excel', or 'string'. If that match works the first element is evaluated as described above otherwise it is evaluated as a string.

GLOBAL VARIABLES ^

$ENV{Smart_Comments}

The module uses Smart::Comments if the '-ENV' option is set. The 'use' is encapsulated in an if block triggered by an environmental variable to comfort non-believers. Setting the variable $ENV{Smart_Comments} in a BEGIN block will load and turn on smart comment reporting. There are three levels of 'Smartness' available in this module '###', '####', and '#####'.

SUPPORT ^

github DateTimeX-Mashup-Shiras/issues

TODO ^

1. Support Timezone input and changes

2. Support custom epoch input and changes

3. Add Log::Shiras debugging in exchange for Smart::Comments

* Get Log::Shiras CPAN ready first!

AUTHOR ^

Jed

jandrew@cpan.org

COPYRIGHT ^

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

The full text of the license can be found in the LICENSE file included with this module.

This software is copyrighted (c) 2013 by Jed Lund.

DEPENDANCIES ^

version

MooseX::Types

MooseX::Types::Moose

DateTime

DateTime::Format::Epoch

DateTime::Format::Excel

DateTime::Format::Flexible

SEE ALSO ^

Time::Piece

MooseX::Types::Perl

Date::Parse

Date::Manip::Date

DateTimeX::Format

syntax highlighting: