Beagle::Manual::Cookbook - Cookbook
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.
Beagle::Plugin::Bar
Beagle::Plugin::Bar::Model::Foo
Beagle, Beagle::Manual::Tutorial, Beagle::Manual::ENV
sunnavy <sunnavy@gmail.com>
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.
To install Beagle, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Beagle
CPAN shell
perl -MCPAN -e shell install Beagle
For more information on module installation, please visit the detailed CPAN module installation guide.