| 1 | package WebAPI::DBIC::Resource::JSONAPI::Role::Set; | ||
| 2 | 25 | $WebAPI::DBIC::Resource::JSONAPI::Role::Set::VERSION = '0.004002'; | |
| 3 | |||
| 4 | 25 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 25 | ▶ | use Carp qw(confess); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 25 | requires '_build_content_types_provided'; | |
| 9 | 25 | requires 'encode_json'; | |
| 10 | 25 | requires 'set'; | |
| 11 | 25 | requires 'render_jsonapi_response'; | |
| 12 | 25 | requires 'jsonapi_type'; | |
| 13 | |||
| 14 | |||
| 15 | 69 | ▶ | around '_build_content_types_provided' => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 16 | 69 | my $orig = shift; | |
| 17 | 69 | my $self = shift; | |
| 18 | 69 | my $types = $self->$orig(); | |
| 19 | 69 | unshift @$types, { 'application/vnd.api+json' => 'to_json_as_jsonapi' }; | |
| 20 | 69 | return $types; | |
| 21 | 25 | }; | |
| 22 | |||
| 23 | |||
| 24 | 9 | ▶ | sub to_json_as_jsonapi { |
|
Subroutine
to_json_as_jsonapi: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 25 | 9 | my $self = shift; | |
| 26 | 9 | return $self->encode_json( $self->render_jsonapi_response() ); | |
| 27 | } | ||
| 28 | |||
| 29 | |||
| 30 | 25 | 1; | |
| 31 | |||
| 32 | __END__ | ||