Access the attribute metaclass from a typecoercion?

[email protected] ("Dan Harbin")
Newsgroups perl.moose
Message-ID <[email protected]>
Stevan, Mooseniks,

I have a "DateTime" attribute trait that has a "date_format" like so:

has date_format => (
    is      => 'rw',
    isa     => 'Str',
    default => '%F %T',
);


I would like to have a type coercion that will use
DateTime::Format::Strptime to coerce a Str into a DateTime based on
that "date_format".

For that, I would need access to the attribute metaclass from the
"via" block.  Is there a way?

Dan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.