Created
July 4, 2011 15:05
-
-
Save hideo55/1063449 to your computer and use it in GitHub Desktop.
Moose coerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package WWW::ImagePager; | |
use Any::Moose; | |
use Any::Moose '::Util::TypeConstraints'; | |
use URI; | |
class_type 'URI'; | |
coerce 'URI' => from 'Str' => via { URI->new(shift) }; | |
has 'basepage' => ( is => 'rw', isa => 'URI', coerce => 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment