Pod::WSDL::Fault - Represents the WSDL pod describing the fault of a method (internal use only)


Pod-WSDL documentation Contained in the Pod-WSDL distribution.

Index


Code Index:

NAME

Top

Pod::WSDL::Fault - Represents the WSDL pod describing the fault of a method (internal use only)

SYNOPSIS

Top

  use Pod::WSDL::Fault;
  my $fault = new Pod::WSDL::Fault('_FAULT My::Fault This happens if something happens');

DESCRIPTION

Top

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.

METHODS

Top

new

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

EXTERNAL DEPENDENCIES

Top

  [none]

EXAMPLES

Top

see Pod::WSDL

BUGS

Top

see Pod::WSDL

TODO

Top

see Pod::WSDL

SEE ALSO

Top

  Pod::WSDL :-)

AUTHOR

Top

Tarek Ahmed, <bloerch -the character every email address contains- oelbsk.org>

COPYRIGHT AND LICENSE

Top


Pod-WSDL documentation Contained in the Pod-WSDL distribution.

package Pod::WSDL::Fault;
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},
	descr     => {get => 1, set =>  0},
	wsdlName  => {get => 1, set =>  0},
);

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

	$str ||= '' ;  # avoid warnings here, will die soon
	$str =~ s/^\s*_FAULT\s*//i or die "_FAULT statements must have structure '_FAULT <type> <text>', like '_FAULT My::Fault This is my documentation'";
	my ($type, $descr) = split /\s+/, $str, 2;

	my $wsdlName = $type;
	$wsdlName =~ s/::(.)/uc $1/eg;

	$descr ||= '';
	
	bless {
		_type     => $type,
		_descr    => $descr,
		_wsdlName => ucfirst $wsdlName,
	}, $pkg;
}

1;
__END__