| 1 | package OpenID::Lite::Message::Decoder::Hash; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 1 | ▶ | use Any::Moose; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 1 | ▶ | use OpenID::Lite::Message; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 0 | ▶ | sub decode { | ||||||||||||
|
Subroutine
decode: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||
| 7 | 0 | my ( $self, $hash ) = @_; | |||||||||||||
| 8 | 0 | my $message = OpenID::Lite::Message->new; | |||||||||||||
| 9 | 0 | for my $key (%$hash) { | |||||||||||||
| 10 | 0 | ▶ | if ( $key =~ /^openid\.(.+)$/ ) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 11 | 0 | $message->set( $1, $hash->{$key} ); | |||||||||||||
| 12 | } | ||||||||||||||
| 13 | elsif ( $key =~ /^openid\.(.+)\.(.+)$/ ) { | ||||||||||||||
| 14 | 0 | my $ext_name = $1; | |||||||||||||
| 15 | 0 | my $ext_key = $2; | |||||||||||||
| 16 | 0 | ▶ | if ( $ext_name eq 'ns' ) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 17 | $message->register_extension_namespace( $ext_key, | ||||||||||||||
| 18 | 0 | $hash->{$key} ); | |||||||||||||
| 19 | } | ||||||||||||||
| 20 | else { | ||||||||||||||
| 21 | 0 | $message->set_extension( $ext_name, $ext_key, $hash->{$key} ); | |||||||||||||
| 22 | } | ||||||||||||||
| 23 | } | ||||||||||||||
| 24 | else { | ||||||||||||||
| 25 | 0 | $message->set_extra( $key, $hash->{$key} ); | |||||||||||||
| 26 | } | ||||||||||||||
| 27 | } | ||||||||||||||
| 28 | 0 | return $message; | |||||||||||||
| 29 | } | ||||||||||||||
| 30 | |||||||||||||||
| 31 | 1 | ▶ | no Any::Moose; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 32 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||
| 33 | 1 | 1; | |||||||||||||
| 34 | |||||||||||||||
| 35 | |||||||||||||||