| 1 | package JSON::RPC::Client::Any; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 1 | our $VERSION = 1.28; | |||||||||||||
| 7 | |||||||||||||||
| 8 | 1 | our @ISA; | |||||||||||||
| 9 | |||||||||||||||
| 10 | 1 | ▶ | BEGIN { | ||||||||||||
|
Subroutine
BEGIN: called CC=3 SCAR=16.0
| |||||||||||||||
| 11 | 1 | ▶ | if ( eval { require JSON::RPC::Legacy::Client } ) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 12 | 1 | push @ISA, 'JSON::RPC::Legacy::Client'; | |||||||||||||
| 13 | } | ||||||||||||||
| 14 | 0 | elsif ( eval { require JSON::RPC::Client } ) { | |||||||||||||
| 15 | 0 | push @ISA, 'JSON::RPC::Client'; | |||||||||||||
| 16 | } | ||||||||||||||
| 17 | else { | ||||||||||||||
| 18 | 0 | die "Unable to find JSON RPC Client implementation"; | |||||||||||||
| 19 | } | ||||||||||||||
| 20 | }; | ||||||||||||||
| 21 | |||||||||||||||
| 22 | =head1 NAME | ||||||||||||||
| 23 | |||||||||||||||
| 24 | JSON::RPC::Client::Any -- wrap in an available JSON RPC Client implementation | ||||||||||||||
| 25 | |||||||||||||||
| 26 | =head1 SYNOPSIS | ||||||||||||||
| 27 | |||||||||||||||
| 28 | use JSON::RPC::Client::Any; | ||||||||||||||
| 29 | |||||||||||||||
| 30 | my $c = JSON::RPC::Client::Any->new() | ||||||||||||||
| 31 | ... | ||||||||||||||
| 32 | |||||||||||||||
| 33 | =head1 DESCRIPTION | ||||||||||||||
| 34 | |||||||||||||||
| 35 | B<JSON::RPC::Client::Any> is a simple class, which finds an available JSON RPC | ||||||||||||||
| 36 | client implementation and descends from it. It saves you the hassle of checking | ||||||||||||||
| 37 | whether you have C<JSON::RPC::Client> or C<JSON::RPC::Legacy::Client> | ||||||||||||||
| 38 | available. | ||||||||||||||
| 39 | |||||||||||||||
| 40 | =head1 SEE ALSO | ||||||||||||||
| 41 | |||||||||||||||
| 42 | =over | ||||||||||||||
| 43 | |||||||||||||||
| 44 | =item L<JSON::RPC::Client> | ||||||||||||||
| 45 | |||||||||||||||
| 46 | =item L<JSON::RPC::Legacy::Client> | ||||||||||||||
| 47 | |||||||||||||||
| 48 | =back | ||||||||||||||
| 49 | |||||||||||||||
| 50 | =head1 COPYRIGHT & LICENSE | ||||||||||||||
| 51 | |||||||||||||||
| 52 | Copyright (c) 2013 Damyan Ivanov L<dmn@debian.org> | ||||||||||||||
| 53 | |||||||||||||||
| 54 | This module is free software; you can redistribute it and/or modify it under | ||||||||||||||
| 55 | the terms of the GNU General Public License as published by the Free Software | ||||||||||||||
| 56 | Foundation; either version 2, or (at your option) any later version. | ||||||||||||||
| 57 | |||||||||||||||
| 58 | =cut | ||||||||||||||