| 1 | package Business::TrueLayer::Types; | ||||||||||
| 2 | |||||||||||
| 3 | 9 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 9 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 9 | ▶ | use Moose::Util::TypeConstraints; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | # objects can be Test::MockObject(s) so we can do "end to end" | ||||||||||
| 9 | # testing without actually going out on the wire | ||||||||||
| 10 | subtype 'UserAgent' | ||||||||||
| 11 | => as 'Object' | ||||||||||
| 12 | 36 | ▶ | => where { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 13 | 36 | ▶ | $_->isa( 'Mojo::UserAgent' ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | or $_->isa( 'Test::MockObject' ) | ||||||||||
| 15 | } | ||||||||||
| 16 | 9 | ; | |||||||||
| 17 | |||||||||||
| 18 | subtype 'Authenticator' | ||||||||||
| 19 | => as 'Object' | ||||||||||
| 20 | 2 | ▶ | => where { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 21 | 2 | ▶ | $_->isa( 'Business::TrueLayer::Authenticator' ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | or $_->isa( 'Test::MockObject' ) | ||||||||||
| 23 | } | ||||||||||
| 24 | 9 | ; | |||||||||
| 25 | |||||||||||
| 26 | subtype 'Signer' | ||||||||||
| 27 | => as 'Object' | ||||||||||
| 28 | 1 | ▶ | => where { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.6
| |||||||||||
| 29 | 1 | ▶ | $_->isa( 'Business::TrueLayer::Signer' ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | or $_->isa( 'Test::MockObject' ) | ||||||||||
| 31 | } | ||||||||||
| 32 | 9 | ; | |||||||||
| 33 | |||||||||||
| 34 | subtype 'EC512:PrivateKey' | ||||||||||
| 35 | => as 'Object' | ||||||||||
| 36 | 1 | ▶ | => where { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 37 | 1 | $_->isa( 'Crypt::PK::ECC' ) | |||||||||
| 38 | } | ||||||||||
| 39 | 9 | ; | |||||||||
| 40 | |||||||||||
| 41 | coerce 'EC512:PrivateKey' | ||||||||||
| 42 | => from 'Value' | ||||||||||
| 43 | 1 | ▶ | => via { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 44 | 1 | Crypt::PK::ECC->new( $_ ) | |||||||||
| 45 | } | ||||||||||
| 46 | 9 | ; | |||||||||
| 47 | |||||||||||
| 48 | 9 | 1; | |||||||||
| 49 | |||||||||||
| 50 | # vim: ts=4:sw=4:et | ||||||||||