| 1 | 9 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | package Net::Etcd::KV::Compare; | ||||||||||
| 3 | |||||||||||
| 4 | 9 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 9 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 9 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 9 | ▶ | use Types::Standard qw(Str Int Bool HashRef ArrayRef); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 9 | ▶ | use MIME::Base64; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 9 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 9 | ▶ | use JSON; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 9 | with 'Net::Etcd::Role::Actions'; | |||||||||
| 14 | |||||||||||
| 15 | 9 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | =head1 NAME | ||||||||||
| 18 | |||||||||||
| 19 | Net::Etcd::KV::Compare | ||||||||||
| 20 | |||||||||||
| 21 | =cut | ||||||||||
| 22 | |||||||||||
| 23 | 9 | our $VERSION = '0.021'; | |||||||||
| 24 | |||||||||||
| 25 | =head1 DESCRIPTION | ||||||||||
| 26 | |||||||||||
| 27 | Op | ||||||||||
| 28 | |||||||||||
| 29 | |||||||||||
| 30 | =head1 ACCESSORS | ||||||||||
| 31 | |||||||||||
| 32 | =head2 result | ||||||||||
| 33 | |||||||||||
| 34 | result is logical comparison operation for this comparison. | ||||||||||
| 35 | |||||||||||
| 36 | =cut | ||||||||||
| 37 | |||||||||||
| 38 | 9 | has result => ( | |||||||||
| 39 | is => 'ro', | ||||||||||
| 40 | ); | ||||||||||
| 41 | |||||||||||
| 42 | =head2 target | ||||||||||
| 43 | |||||||||||
| 44 | target is the key-value field to inspect for the comparison. | ||||||||||
| 45 | |||||||||||
| 46 | =cut | ||||||||||
| 47 | |||||||||||
| 48 | 9 | has target => ( | |||||||||
| 49 | is => 'ro', | ||||||||||
| 50 | ); | ||||||||||
| 51 | |||||||||||
| 52 | =head2 key | ||||||||||
| 53 | |||||||||||
| 54 | key is the subject key for the comparison operation. | ||||||||||
| 55 | |||||||||||
| 56 | =cut | ||||||||||
| 57 | |||||||||||
| 58 | has key => ( | ||||||||||
| 59 | is => 'ro', | ||||||||||
| 60 | 0 | ▶ | coerce => sub { return encode_base64( $_[0], '' ) if $_[0] }, | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 61 | 9 | ); | |||||||||
| 62 | |||||||||||
| 63 | |||||||||||
| 64 | =head2 version | ||||||||||
| 65 | |||||||||||
| 66 | version is the version of the given key | ||||||||||
| 67 | |||||||||||
| 68 | =cut | ||||||||||
| 69 | |||||||||||
| 70 | 9 | has version => ( | |||||||||
| 71 | is => 'ro', | ||||||||||
| 72 | ); | ||||||||||
| 73 | |||||||||||
| 74 | =head2 create_revision | ||||||||||
| 75 | |||||||||||
| 76 | create_revision is the creation revision of the given key | ||||||||||
| 77 | |||||||||||
| 78 | =cut | ||||||||||
| 79 | |||||||||||
| 80 | 9 | has create_revision => ( | |||||||||
| 81 | is => 'ro', | ||||||||||
| 82 | ); | ||||||||||
| 83 | |||||||||||
| 84 | =head2 mod_revision | ||||||||||
| 85 | |||||||||||
| 86 | mod_revision is the last modified revision of the given key. | ||||||||||
| 87 | |||||||||||
| 88 | =cut | ||||||||||
| 89 | |||||||||||
| 90 | 9 | has mod_revision => ( | |||||||||
| 91 | is => 'ro', | ||||||||||
| 92 | ); | ||||||||||
| 93 | |||||||||||
| 94 | =head2 value | ||||||||||
| 95 | |||||||||||
| 96 | value is the value of the given key, in bytes. | ||||||||||
| 97 | |||||||||||
| 98 | =cut | ||||||||||
| 99 | |||||||||||
| 100 | has value => ( | ||||||||||
| 101 | is => 'ro', | ||||||||||
| 102 | 0 | ▶ | coerce => sub { return encode_base64( $_[0], '' ) if $_[0] }, | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 103 | 9 | ); | |||||||||
| 104 | |||||||||||
| 105 | 9 | 1; | |||||||||