Great!

One more question,

Is there a way to acces to "to_json" and "from_json"  on the plugin?

Thanks!

Ruben.




On Wed, Oct 14, 2015 at 2:19 PM, Yanick Champoux <yanick@babyl.dyndns.org> wrote:
On 2015-10-14 01:49 PM, Stefan Hornburg (Racke) wrote:
> Yanick, would you mind to enhance the POD with this example?

Done.

And sometime tomorrow (ie, as soon as I merge my changes), defining
plugin keywords will get even easier:


        # the classic
        plugin_keywords  'foo', [ 'bar', 'baz' ], quux => sub { ... };

        # tag methods as keywords
        sub some_keyword :PluginKeyword {
                ...;
        }

        # keyword will be 'bar'
        sub foo :PluginKeyword(bar) { ... }

        # keywords "do_it" and "do_them" will both use the method
        sub do_studd :PluginKeyword(do_it do_them) { ... }

        # attributes can be exported as keywords too
        has foo => (
                is => 'ro',
                plugin_keyword => 1,  # will use keyword 'foo'
        );

        has bar => (
                is => 'ro',
                plugin_keyword => 'baz',  # will use keyword 'baz'
        );

        has quux => (
                is => 'ro',
                plugin_keyword => [qw/ this that / ],
                        # will use keyword 'this' and 'that'
        );

Joy,
`/.


_______________________________________________
dancer-users mailing list
dancer-users@dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users



--
____________________________
Rubén Darío Amórtegui Medina
MCE - Ingeniero de Sistemas