| 1 | # ABSTRACT: An object which contains a reference address | ||||||||||
| 2 | package Net::Object::Peer::RefAddr; | ||||||||||
| 3 | |||||||||||
| 4 | 23 | ▶ | use strictures 2; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 23 | our $VERSION = '0.06'; # TRIAL | |||||||||
| 7 | |||||||||||
| 8 | 23 | ▶ | use Scalar::Util qw[ refaddr ]; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 23 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | |||||||||||
| 12 | use overload | ||||||||||
| 13 | 0 | ▶ | '0+' => sub {0 + ${ $_[0] }}, | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 14 | |||||||||||
| 15 | 9 | ▶ | '""' => sub { "${$_[0]}" }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | 5 | ▶ | '+' => sub { my ( $me, $you ) = @_; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 5 | $$me + $you; | |||||||||
| 19 | }, | ||||||||||
| 20 | |||||||||||
| 21 | 1 | ▶ | '==' => sub { my ( $me, $you ) = @_; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 22 | 1 | 0+$me == 0+$you; | |||||||||
| 23 | }, | ||||||||||
| 24 | |||||||||||
| 25 | 4 | ▶ | 'eq' => sub { my ( $me, $you ) = @_; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 4 | "$me" eq "$you"; | |||||||||
| 27 | }, | ||||||||||
| 28 | 23 | ; | |||||||||
| 29 | |||||||||||
| 30 | #pod =begin pod_coverage | ||||||||||
| 31 | #pod | ||||||||||
| 32 | #pod =head4 does | ||||||||||
| 33 | #pod | ||||||||||
| 34 | #pod =end pod_coverage | ||||||||||
| 35 | #pod | ||||||||||
| 36 | #pod =cut | ||||||||||
| 37 | |||||||||||
| 38 | 23 | *does = \&UNIVERSAL::DOES; | |||||||||
| 39 | |||||||||||
| 40 | #pod =method new | ||||||||||
| 41 | #pod | ||||||||||
| 42 | #pod $obj = Net::Object::Peer::RefAddr->new( $reference | $refaddr ); | ||||||||||
| 43 | #pod | ||||||||||
| 44 | #pod =cut | ||||||||||
| 45 | |||||||||||
| 46 | 597 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 47 | |||||||||||
| 48 | 597 | my ( $class, $thing ) = @_; | |||||||||
| 49 | |||||||||||
| 50 | 597 | ▶ | bless( \( ref $thing ? refaddr( $thing ) : $thing ), $class ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 23 | 1; | |||||||||
| 54 | |||||||||||
| 55 | # | ||||||||||
| 56 | # This file is part of Net-Object-Peer | ||||||||||
| 57 | # | ||||||||||
| 58 | # This software is Copyright (c) 2016 by Smithsonian Astrophysical Observatory. | ||||||||||
| 59 | # | ||||||||||
| 60 | # This is free software, licensed under: | ||||||||||
| 61 | # | ||||||||||
| 62 | # The GNU General Public License, Version 3, June 2007 | ||||||||||
| 63 | # | ||||||||||
| 64 | |||||||||||
| 65 | =pod | ||||||||||
| 66 | |||||||||||
| 67 | =head1 NAME | ||||||||||
| 68 | |||||||||||
| 69 | Net::Object::Peer::RefAddr - An object which contains a reference address | ||||||||||
| 70 | |||||||||||
| 71 | =head1 VERSION | ||||||||||
| 72 | |||||||||||
| 73 | version 0.06 | ||||||||||
| 74 | |||||||||||
| 75 | =head1 DESCRIPTION | ||||||||||
| 76 | |||||||||||
| 77 | B<Net::Object::Peer::RefAddr> is a class whose only purpose is | ||||||||||
| 78 | to identify the contents as a refaddr. | ||||||||||
| 79 | |||||||||||
| 80 | =head1 METHODS | ||||||||||
| 81 | |||||||||||
| 82 | =head2 new | ||||||||||
| 83 | |||||||||||
| 84 | $obj = Net::Object::Peer::RefAddr->new( $reference | $refaddr ); | ||||||||||
| 85 | |||||||||||
| 86 | =begin pod_coverage | ||||||||||
| 87 | |||||||||||
| 88 | =head4 does | ||||||||||
| 89 | |||||||||||
| 90 | =end pod_coverage | ||||||||||
| 91 | |||||||||||
| 92 | =head1 AUTHOR | ||||||||||
| 93 | |||||||||||
| 94 | Diab Jerius <djerius@cpan.org> | ||||||||||
| 95 | |||||||||||
| 96 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 97 | |||||||||||
| 98 | This software is Copyright (c) 2016 by Smithsonian Astrophysical Observatory. | ||||||||||
| 99 | |||||||||||
| 100 | This is free software, licensed under: | ||||||||||
| 101 | |||||||||||
| 102 | The GNU General Public License, Version 3, June 2007 | ||||||||||
| 103 | |||||||||||
| 104 | =cut | ||||||||||
| 105 | |||||||||||
| 106 | __END__ | ||||||||||