Subject: | Dancer 2 keywords receive a $self object |
Hello
Now the keywords defined in plugins receive as first argument a
reference to an object (the typical $self).
Then,
register 'sitemap_ignore' => sub {
$Dancer::Plugin::SiteMap::OMIT_ROUTES = \@_;
};
should be (to be completely correct)
register 'sitemap_ignore' => sub {
shift if blessed($_[0]) and $_[0]->isa('Dancer::Core::DSL');
$Dancer::Plugin::SiteMap::OMIT_ROUTES = \@_;
};
and you need to use Scalar::Util 'blessed';
Note that this should not affect the plugin execution. But it can help
other developers to learn how to write dancer 2 compatible modules easier.
Cheers