REST/Transaction.pm

filter: Statementstmt 87.1% 27 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 100% 2 / 2 totaltotal 88.3% 38 / 43 CC 1 SCAR 1.0
CC
1
Cov
87%
retrieve
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« REST/User.pm ↑ Summary REST/Object/Exception.pm »
1 #!perl
2 # PODNAME: RT::Client::REST::Transaction
3 # ABSTRACT: transaction object representation.
4  
5 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 package RT::Client::REST::Transaction;
9 6 $RT::Client::REST::Transaction::VERSION = '0.73';
10 6 ▶use parent 'RT::Client::REST::Object';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 6 ▶use Params::Validate qw(:types);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 6 ▶use RT::Client::REST::Object::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 6 ▶sub _attributes {{
Subroutine _attributes: called CC=1 SCAR=0.0
16 6 id => {
17 validation => {
18 type => SCALAR,
19 regex => qr/^\d+$/,
20 },
21 },
22  
23 creator => {
24 validation => {
25 type => SCALAR,
26 },
27 },
28  
29 type => {
30 validation => {
31 type => SCALAR,
32 },
33 },
34  
35 old_value => {
36 validation => {
37 type => SCALAR,
38 },
39 rest_name => "OldValue",
40 },
41  
42 new_value => {
43 validation => {
44 type => SCALAR,
45 },
46 rest_name => "NewValue",
47 },
48  
49 parent_id => {
50 validation => {
51 type => SCALAR,
52 regex => qr/^\d+$/,
53 },
54 rest_name => 'Ticket',
55 },
56  
57 attachments => {
58 validation => {
59 type => SCALAR,
60 },
61 },
62  
63 time_taken => {
64 validation => {
65 type => SCALAR,
66 },
67 rest_name => 'TimeTaken',
68 },
69  
70 field => {
71 validation => {
72 type => SCALAR,
73 },
74 },
75  
76 content => {
77 validation => {
78 type => SCALAR,
79 },
80 },
81  
82 created => {
83 validation => {
84 type => SCALAR,
85 },
86 is_datetime => 1,
87 },
88  
89 description => {
90 validation => {
91 type => SCALAR|UNDEF,
92 },
93 },
94  
95 data => {
96 validation => {
97 type => SCALAR,
98 },
99 },
100 }}
101  
102 1 ▶sub rt_type { 'transaction' }
Subroutine rt_type: called CC=1 SCAR=0.0
Pod documented
103  
104 0 ▶sub retrieve {
Subroutine retrieve: not called CC=1 SCAR=6.9
Pod documented
105 0 my $self = shift;
106  
107 0 $self->from_form(
108 $self->rt->get_transaction(
109 parent_id => $self->parent_id,
110 id => $self->id,
111 ),
112 );
113  
114 0 $self->{__dirty} = {};
115  
116 0 return $self;
117 }
118  
119 # Override unsupported methods.
120 6 for my $method (qw(store search count)) {
121 6 ▶ no strict 'refs'; ## no critic (ProhibitNoStrict)
Subroutine BEGIN: called CC=1 SCAR=0.0
122 3 ▶ *$method = sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
123 3 my $self = shift;
124 3 RT::Client::REST::Object::IllegalMethodException->throw(
125 ref($self) . " does not support '$method' method",
126 );
127 18 };
128 }
129  
130 6 __PACKAGE__->_generate_methods;
131  
132 6 1;
133  
134 __END__
« REST/User.pm ↑ Summary REST/Object/Exception.pm »