coerce 'DateTime'
=> from 'Str'
- => via { DateTime::Format::MySQL->parse_datetime($_) };
+ => via { DateTime::Format::MySQL->parse_datetime($_) };
has 'timestamp' => (is => 'rw', isa => 'DateTime', coerce => 1);
my $next = shift;
my ($self, $timestamp) = @_;
# assume we get a DateTime object ...
- $next->($self, $timestamp->epoch);
+ $self->$next( $timestamp->epoch );
};
It is also possible to do deflation using coercion, but this tends