Protocol::XMLRPC::Value::Boolean - XML-RPC array


Protocol-XMLRPC documentation Contained in the Protocol-XMLRPC distribution.

Index


Code Index:

NAME

Top

Protocol::XMLRPC::Value::Boolean - XML-RPC array

SYNOPSIS

Top

    my $true  = Protocol::XMLRPC::Value::Boolean->new(1);
    my $true  = Protocol::XMLRPC::Value::Boolean->new('true');
    my $false = Protocol::XMLRPC::Value::Boolean->new(0);
    my $false = Protocol::XMLRPC::Value::Boolean->new('false');

DESCRIPTION

Top

XML-RPC boolean

METHODS

Top

new

Creates new Protocol::XMLRPC::Value::Boolean instance.

type

Returns 'boolean'.

value

    my $boolean = Protocol::XMLRPC::Value::Boolean->new(1);
    # $boolean->value returns 1

    my $boolean = Protocol::XMLRPC::Value::Boolean->new('false');
    # $boolean->value returns 'false'

Returns serialized Perl5 boolean.

to_string

    my $boolean = Protocol::XMLRPC::Value::Boolean->new(1);
    # $boolean->to_string is now '<boolean>1</boolean>'

XML-RPC boolean string representation.

AUTHOR

Top

Viacheslav Tykhanovskyi, vti@cpan.org.

COPYRIGHT

Top


Protocol-XMLRPC documentation Contained in the Protocol-XMLRPC distribution.

package Protocol::XMLRPC::Value::Boolean;

use strict;
use warnings;

use base 'Protocol::XMLRPC::Value';

sub type {'boolean'}

sub to_string {
    my $self = shift;

    my $value = $self->value;

    return "<boolean>$value</boolean>";
}

1;
__END__