File: Any.pm

package info (click to toggle)
kgb-bot 1.33-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 648 kB
  • ctags: 169
  • sloc: perl: 3,738; sh: 173; makefile: 29
file content (58 lines) | stat: -rw-r--r-- 1,234 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package JSON::RPC::Client::Any;

use strict;
use warnings;

our $VERSION = 1.28;

our @ISA;

BEGIN {
    if ( eval { require JSON::RPC::Legacy::Client } ) {
        push @ISA, 'JSON::RPC::Legacy::Client';
   }
   elsif ( eval { require JSON::RPC::Client } ) {
        push @ISA, 'JSON::RPC::Client';
   }
   else {
       die "Unable to find JSON RPC Client implementation";
   }
};

=head1 NAME

JSON::RPC::Client::Any -- wrap in an available JSON RPC Client implementation

=head1 SYNOPSIS

 use JSON::RPC::Client::Any;

 my $c = JSON::RPC::Client::Any->new()
 ...

=head1 DESCRIPTION

B<JSON::RPC::Client::Any> is a simple class, which finds an available JSON RPC
client implementation and descends from it. It saves you the hassle of checking
whether you have C<JSON::RPC::Client> or C<JSON::RPC::Legacy::Client>
available.

=head1 SEE ALSO

=over

=item L<JSON::RPC::Client>

=item L<JSON::RPC::Legacy::Client>

=back

=head1 COPYRIGHT & LICENSE

Copyright (c) 2013 Damyan Ivanov L<dmn@debian.org>

This module is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.

=cut