Protocol::XMLRPC::Value - a base class for scalar values


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

Index


Code Index:

NAME

Top

Protocol::XMLRPC::Value - a base class for scalar values

SYNOPSIS

Top

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

    use strict;
    use warnings;

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

    ...

    1;

DESCRIPTION

Top

This is a base class for all scalar types. Used internally.

ATTRIBUTES

Top

value

Hold parameter value.

METHODS

Top

new

Returns new Protocol::XMLRPC::Value instance.

to_string

String representation.

AUTHOR

Top

Viacheslav Tykhanovskyi, vti@cpan.org.

COPYRIGHT

Top


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

package Protocol::XMLRPC::Value;

use strict;
use warnings;

use overload '""' => sub { shift->to_string }, fallback => 1;

sub new {
    my $class = shift;

    my $value; $value = shift if @_ % 2;

    my $self = {@_};
    bless $self, $class;

    $self->value($value) if defined $value;

    return $self;
}

sub value { defined $_[1] ? $_[0]->{value} = $_[1] : $_[0]->{value} }

sub to_string { '' }

1;
__END__