[dancer-users] Call to all Dancer2 plugin writers

Rubén Amórtegui ruben.amortegui at gmail.com
Thu Oct 15 20:22:28 BST 2015


Just and update:

I used the same code on the DSL module to call the functions, but I'm
wondering if there is a better way to do it from the plugin.

require Dancer2::Serializer::JSON;
Dancer2::Serializer::JSON::to_json( $my_stuff );

Ruben.

On Thu, Oct 15, 2015 at 12:06 PM, Rubén Amórtegui <ruben.amortegui at gmail.com
> wrote:

> 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 at 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 at dancer.pm
>> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>>
>
>
>
> --
> ____________________________
> Rubén Darío Amórtegui Medina
> MCE - Ingeniero de Sistemas
>



-- 
____________________________
Rubén Darío Amórtegui Medina
MCE - Ingeniero de Sistemas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20151015/9ac0112f/attachment.html>


More information about the dancer-users mailing list