Re: Access the attribute metaclass from a typecoercion?
[email protected] (Stevan Little)
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <[email protected]> |
Dan, No sorry, however see the "checking consistency between attributes" thread, Sartak will be working on a before/after/around version of trigger which should be able to do exactly that. - Stevan On Jul 16, 2008, at 9:45 AM, Dan Harbin wrote: > 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