| 1 | package WebAPI::DBIC::Resource::HAL::Role::Item; | ||
| 2 | 25 | $WebAPI::DBIC::Resource::HAL::Role::Item::VERSION = '0.004002'; | |
| 3 | |||
| 4 | 25 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | |||
| 7 | 25 | requires '_build_content_types_provided'; | |
| 8 | 25 | requires 'render_item_as_hal_hash'; | |
| 9 | 25 | requires 'encode_json'; | |
| 10 | 25 | requires 'item'; | |
| 11 | |||
| 12 | |||
| 13 | 67 | ▶ | around '_build_content_types_provided' => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 14 | 67 | my $orig = shift; | |
| 15 | 67 | my $self = shift; | |
| 16 | 67 | my $types = $self->$orig(); | |
| 17 | 67 | unshift @$types, { 'application/hal+json' => 'to_json_as_hal' }; | |
| 18 | 67 | return $types; | |
| 19 | 25 | }; | |
| 20 | |||
| 21 | 19 | ▶ | sub to_json_as_hal { return $_[0]->encode_json($_[0]->render_item_as_hal_hash($_[0]->item)) } |
|
Subroutine
to_json_as_hal: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 22 | |||
| 23 | 25 | 1; | |
| 24 | |||
| 25 | __END__ | ||