NAME
Beagle::Manual::Cookbook - Cookbook
DESCRIPTION
Add a new entry type
To add a new type "Foo" with an extra meta key "category", you just need to create a module Beagle::Model::Foo which inherits from Beagle::Model::Entry.
package Beagle::Model::Foo;
use Any::Moose;
extends 'Beagle::Model::Entry';
has 'category' => (
isa => 'Str',
is => 'rw',
default => '',
);
1;
That's it, now you have foo and foos commands automatically.
You can also add the new type to a plugin like Beagle::Plugin::Bar
and change its name to Beagle::Plugin::Bar::Model::Foo
. if so, the new type is loaded only if you load the plugin.
SEE ALSO
Beagle, Beagle::Manual::Tutorial, Beagle::Manual::ENV
AUTHOR
sunnavy <sunnavy@gmail.com>
LICENCE AND COPYRIGHT
Copyright 2011 sunnavy@gmail.com
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.