Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

refactor object functionality #24

Closed
alnewkirk opened this Issue · 0 comments

1 participant

Al Newkirk
Al Newkirk
Owner

refactor the object keyword to create class methods that return instantiated object based on the registered fields only.

e.g.:

object to_user => {

type => 'MyApp::User',
args => ['name', 'email', ...], # defaults to all registered fields
list => 'hash' # defaults to list, could also be a coderef

};

my $user = $self->to_user;

basically shorthand for

sub to_user {

my $self = shift;

return MyApp::User->new($self->params->list);

}

Al Newkirk alnewkirk closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.