POD for WebGUI::Types

This commit is contained in:
Colin Kuskie 2010-05-21 18:39:36 -07:00
parent 74c6f50bd2
commit a4dd6f1362

View file

@ -1,8 +1,49 @@
package WebGUI::Types;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2009 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use Moose;
use Moose::Util::TypeConstraints;
=head1 NAME
Package WebGUI::Types
=head1 DESCRIPTION
A package to hold all Moose types for WebGUI::Definition based classes.
=head1 SYNOPSIS
use WebGUI::Types;
=head1 METHODS
These types are provided by this class:
=head2 WebGUI::Type::JSONArray
The JSONArray is an subtype of ArrayRef, with coercions. If a string is applied to the property
with this type, it ties to pass it through JSON::from_json. If that fails, then it returns an
empty arrayref.
Similarly, if an undef value is applied, it is coerced into an empty arrayref.
=cut
subtype 'WebGUI::Type::JSONArray'
=> as 'ArrayRef'
;