I have a question regarding Spiffy: How do I define the constructor to take parameters?
At the moment I provide the possibility to configure an object via an init method which the client should call right after constructing the object, however, I'd prefer to allow those parameters to be passed via new.
Thank youpackage VesrRec; use strict; use warnings; use Spiffy -Base; field 'raw'; sub new() { my $self = super; } sub init { my ($raw) = @_; $self->raw($raw); }
In reply to Spiffy: How to define the constructor to take parameters by bwagner
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |