Skip to content

Instantly share code, notes, and snippets.

@nihen
Created May 10, 2011 13:28
Show Gist options
  • Save nihen/964465 to your computer and use it in GitHub Desktop.
Save nihen/964465 to your computer and use it in GitHub Desktop.
PerRequest model instance
package Hoge::Model::MyModel;
use base 'Catalyst::Model::Factory';
#use base 'Catalyst::Model::Factory::PerRequest';
#use base 'Catalyst::Model::Adaptor';
__PACKAGE__->config( class => 'Hoge::MyModel' );
1;
package Hoge::MyModel;
use Moose;
has 'arg1' => (
is => 'ro',
isa => 'Str',
);
sub yay {
my $self = shift;
$self->{_count}++ . 'yay' . $self->arg1;
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment