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 <[email protected] > 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 <[email protected]> > 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 >> [email protected] >> 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
_______________________________________________ dancer-users mailing list [email protected] http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
