Group
Extension

Matches 1

Web-Machine ( D/DR/DROLSKY/Web-Machine-0.17.tar.gz, DROLSKY, 2016; MetaCPAN )
Web-Machine/lib/Web/Machine/Resource.pm ( view source; MetaCPAN )
    package HelloWorld::Resource;
        use strict;
        use warnings;
        use JSON::XS qw[ encode_json ];

        use parent 'Web::Machine::Resource';

        sub init {
            my $se
  $self->{json}
                = exists $args->{json}
                ? $args->{json}
                : {};
        }

        sub content_types_provided { [ { 'application/json' => 'to_json' } ] }

        sub to_json {
            my $self = shift;

            encode_json( $self->{json} );
        }
    }

    Web::Machine->new(
        resource      => 'HelloWorld::Resource',
        resource

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.