Catalyst::Helper::Model::Gedcom - Helper for Gedcom models


Catalyst-Model-Gedcom documentation Contained in the Catalyst-Model-Gedcom distribution.

Index


Code Index:

NAME

Top

Catalyst::Helper::Model::Gedcom - Helper for Gedcom models

SYNOPSIS

Top

  script/myapp_create.pl model Gedcom Gedcom myfamily.ged

DESCRIPTION

Top

Helper for the Catalyst Gedcom model.

METHODS

Top

mk_compclass

Makes the Gedcom model class.

mk_comptest

Makes tests for the Gedcom model.

SEE ALSO

Top

Catalyst::Manual, Catalyst::Test, Catalyst::Helper

AUTHOR

Top

Brian Cassidy <bricas@cpan.org>

COPYRIGHT AND LICENSE

Top

NAME

Top

[% class %] - Gedcom Catalyst model component

SYNOPSIS

Top

See [% app %].

DESCRIPTION

Top

Gedcom Catalyst model component.

AUTHOR

Top

[% author %]

LICENSE

Top

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


Catalyst-Model-Gedcom documentation Contained in the Catalyst-Model-Gedcom distribution.
package Catalyst::Helper::Model::Gedcom;

use strict;
use warnings;

our $VERSION = '0.05';

sub mk_compclass {
    my ( $self, $helper, $filename ) = @_;

    die( 'No filename specified' ) unless $filename;

    $helper->{ filename } = $filename;
    $helper->render_file( 'modelclass', $helper->{ file } );

    return 1;
}

sub mk_comptest {
    my ( $self, $helper ) = @_;

    $helper->render_file( 'modeltest', $helper->{ test } );
}

1;

__DATA__

__modelclass__
package [% class %];

use strict;
use base qw( Catalyst::Model::Gedcom );

__PACKAGE__->config(
    gedcom_file => [% filename %],
    read_only   => 1
);

1;
__modeltest__
use Test::More tests => 2;
use_ok(Catalyst::Test, '[% app %]');
use_ok('[% class %]');