File Coverage

blib/lib/Thrift/Parser/Method.pm
Criterion Covered Total %
statement 11 15 73.3
branch n/a
condition 0 2 0.0
subroutine 4 6 66.6
pod 2 3 66.6
total 17 26 65.3


line stmt bran cond sub pod time code
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 object. See subclass documentation for specifics.
10              
11             =cut
12              
13 6     6   34 use strict;
  6         14  
  6         206  
14 6     6   35 use warnings;
  6         14  
  6         163  
15 6     6   32 use base qw(Class::Accessor::Grouped);
  6         11  
  6         7224  
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 that informed the creation of this class.
23              
24             =head2 idl_doc
25              
26             Returns a reference to the L 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 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 subclasses that represent available exceptions to this method, keyed on the name in the specification.
39              
40             =cut
41              
42             sub new {
43 0     0 0 0 my ($class, $self) = @_;
44 0   0     0 $self ||= {};
45 0         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 call of the given L.
53              
54             =cut
55              
56             sub compose_message_call {
57 2     2 1 724 my ($class, %args) = @_;
58              
59 2         30 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 0     0 1   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
85              
86             =cut
87              
88             1;