| 1 | 2 | ▶ | use v5.20.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | package JMAP::Tester::SentenceBroker 0.113; | ||
| 3 | |||
| 4 | 2 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | with 'JMAP::Tester::Role::SentenceBroker'; | |
| 6 | |||
| 7 | 2 | ▶ | use experimental 'signatures'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 2 | ▶ | use Data::OptList (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 2 | ▶ | use JMAP::Tester::Abort; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 2 | ▶ | use JMAP::Tester::Response::Sentence; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 2 | ▶ | use JMAP::Tester::Response::Paragraph; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 2 | has response => ( | |
| 15 | is => 'ro', | ||
| 16 | weak_ref => 1, | ||
| 17 | required => 1, | ||
| 18 | ); | ||
| 19 | |||
| 20 | 29 | ▶ | sub client_ids_for_items ($self, $items_ref) { |
|
Subroutine
client_ids_for_items: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 21 | 29 | map {; $_->[2] } @$items_ref; | |
| 22 | } | ||
| 23 | |||
| 24 | 147 | ▶ | sub sentence_for_item ($self, $item) { |
|
Subroutine
sentence_for_item: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 25 | 147 | return JMAP::Tester::Response::Sentence->new({ | |
| 26 | name => $item->[0], | ||
| 27 | arguments => $item->[1], | ||
| 28 | client_id => $item->[2], | ||
| 29 | |||
| 30 | sentence_broker => $self, | ||
| 31 | }); | ||
| 32 | } | ||
| 33 | |||
| 34 | 21 | ▶ | sub paragraph_for_items ($self, $items_ref) { |
|
Subroutine
paragraph_for_items: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 35 | return JMAP::Tester::Response::Paragraph->new({ | ||
| 36 | 21 | sentences => [ map {; $self->sentence_for_item($_) } @$items_ref ], | |
| 37 | }); | ||
| 38 | } | ||
| 39 | |||
| 40 | 10 | ▶ | sub strip_json_types ($self, $struct) { |
|
Subroutine
strip_json_types: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 41 | 10 | state $typist = JSON::Typist->new; | |
| 42 | 10 | $typist->strip_types($struct); | |
| 43 | } | ||
| 44 | |||
| 45 | 2 | ▶ | no Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 46 | 2 | 1; | |
| 47 | |||
| 48 | __END__ | ||