File: Return.pm

package info (click to toggle)
libpod-wsdl-perl 0.063-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 316 kB
  • sloc: perl: 1,808; xml: 44; makefile: 2
file content (88 lines) | stat: -rw-r--r-- 1,908 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package Pod::WSDL::Return;
use strict;
use warnings;
use Pod::WSDL::AUTOLOAD;

our $VERSION = "0.05";
our @ISA = qw/Pod::WSDL::AUTOLOAD/;

our %FORBIDDEN_METHODS = (
	type  => {get => 1, set =>  0},
	array => {get => 1, set =>  0},
	descr => {get => 1, set =>  0},
);

sub new {
	my ($pkg, $str) = @_;

	defined $str or $str = ''; # avoids warnings, dies soon
	$str =~ s/\s*_RETURN\s*//i;
	my ($type, $descr) = split /\s+/, $str, 2;

	$type ||= ''; # avoids warnings, dies soon

	$type =~ /([\$\@])(.+)/;
	die "Type '$type' must have structure (\$|\@)<typename>, e.g. '\$boolean' or '\@string', died" unless $1 and $2;
	
	bless {
		_type   => $2,
		_descr  => $descr || '',
		_array  => $1 eq '@' ? 1 : 0,
	}, $pkg;
}

1;
__END__

=head1 NAME

Pod::WSDL::Return - Represents the WSDL pod for the return value of a method (internal use only)

=head1 SYNOPSIS

  use Pod::WSDL::Return;
  my $return = new Pod::WSDL::Return('_RETURN $string This returns blah ...');

=head1 DESCRIPTION

This module is used internally by Pod::WSDL. It is unlikely that you have to interact directly with it. If that is the case, take a look at the code, it is rather simple.

=head1 METHODS

=head2 new

Instantiates a new Pod::WSDL::Param. The method needs one parameter, the _RETURN string from the pod. Please see SYNOPSIS or the section "Pod Syntax" in the description of Pod::WSDL.

=head1 EXTERNAL DEPENDENCIES

  [none]

=head1 EXAMPLES

see Pod::WSDL

=head1 BUGS

see Pod::WSDL

=head1 TODO

see Pod::WSDL

=head1 SEE ALSO

  Pod::WSDL
 
=head1 AUTHOR

Tarek Ahmed, E<lt>bloerch -the character every email address contains- oelbsk.orgE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2006 by Tarek Ahmed

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.5 or,
at your option, any later version of Perl 5 you may have available.

=cut