Parser/Method.pm

filter: Statementstmt 64.2% 9 / 14 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 60.0% 3 / 5 Podpod n/a totaltotal 54.5% 12 / 22 CC 2 SCAR 10.4
CC
2
Cov
56%
new
6.0
compose_message_call
2.0
BEGIN
1.0
CRAP 2.8
« IDL/Base.pm ↑ Summary Parser/Exceptions.pm »
1 package Thrift::Parser::Method;
2  
3 =head1 NAME
4  
5 Thrift::Parser::Method - A Method call
6  
7 =head1 DESCRIPTION
8  
9 Parser representation of a service method call. Created from an L<Thrift::IDL::Method> object. See subclass documentation for specifics.
10  
11 =cut
12  
13 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 6 ▶use base qw(Class::Accessor::Grouped);
Subroutine BEGIN: called CC=1 SCAR=0.0
16 __PACKAGE__->mk_group_accessors('inherited', qw(idl idl_doc name return_class throw_classes));
17  
18 =head1 METHODS
19  
20 =head2 idl
21  
22 Returns a reference to the L<Thrift::IDL::Method> that informed the creation of this class.
23  
24 =head2 idl_doc
25  
26 Returns a reference to the L<Thrift::IDL> object that this was formed from.
27  
28 =head2 name
29  
30 Returns the simple name of the method.
31  
32 =head2 return_class
33  
34 Returns the L<Thrift::Parser::Type> subclass that represents the type of value that's an expected return value for this method.
35  
36 =head2 throw_classes
37  
38 Returns a hash ref of L<Thrift::Parser::Type::Exception> subclasses that represent available exceptions to this method, keyed on the name in the specification.
39  
40 =cut
41  
42 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
43 0 my ($class, $self) = @_;
44 0 ▶ $self ||= {};
Condition0%0/2
$self ||= {}
l!l
00
MC/DC0%0/1
$self ||= {}
$self
Truth table0%0/2
A
A= $self
Aresult
11
00
45 0 return bless $self, $class;
46 }
47  
48 =head2 compose_message_call
49  
50 my $message = $subclass->compose_message_call(...);
51  
52 Call with a list of key/value pairs. See the derived subclass for a list of accepted keys. The value can either be an object that's strictly typed or simple Perl data structure that is a permissable argument to the C<compose()> call of the given L<Thrift::Parser::Type>.
53  
54 =cut
55  
56 0 ▶sub compose_message_call {
Subroutine compose_message_call: not called CC=1 SCAR=6.9
57 0 my ($class, %args) = @_;
58  
59 0 return Thrift::Parser::Message->new({
60 method => $class,
61 arguments => Thrift::Parser::FieldSet->compose($class, %args),
62 type => TMessageType::CALL,
63 });
64 }
65  
66 =head2 docs_as_pod
67  
68 Returns a POD formatted string that documents a derived class.
69  
70 =cut
71  
72 sub docs_as_pod {
73 Thrift::Parser::Type::docs_as_pod(@_);
74 }
75  
76 =head1 COPYRIGHT
77  
78 Copyright (c) 2009 Eric Waters and XMission LLC (http://www.xmission.com/). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
79  
80 The full text of the license can be found in the LICENSE file included with this module.
81  
82 =head1 AUTHOR
83  
84 Eric Waters <ewaters@gmail.com>
85  
86 =cut
87  
88 1;
« IDL/Base.pm ↑ Summary Parser/Exceptions.pm »