The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Wikibase::Datatype::Value - Wikibase value datatype.

SYNOPSIS

 use Wikibase::Datatype::Value;

 my $obj = Wikibase::Datatype::Value->new(%params);
 my $type = $obj->type;
 my $value = $obj->value;

DESCRIPTION

This datatype is base class for all Value datatypes.

METHODS

new

 my $obj = Wikibase::Datatype::Value->new(%params);

Constructor.

Returns instance of object.

  • type

    Type of instance. Default value is undef.

  • value

    Value of instance. Parameter is required.

type

 my $type = $obj->type;

Get type.

Returns string.

value

 my $value = $obj->value;

Get value.

Returns string.

ERRORS

 new():
         From Mo::utils::check_required():
                 Parameter 'value' is required.
                 Parameter 'type' is required.

EXAMPLE

 use strict;
 use warnings;

 use Wikibase::Datatype::Value;

 # Object.
 my $obj = Wikibase::Datatype::Value->new(
         'value' => 'foo',
         'type' => 'string',
 );

 # Get value.
 my $value = $obj->value;

 # Get type.
 my $type = $obj->type;

 # Print out.
 print "Value: $value\n";
 print "Type: $type\n";

 # Output:
 # Value: foo
 # Type: string

DEPENDENCIES

Mo, Mo::utils.

SEE ALSO

Wikibase::Datatype::Value::Item

Wikibase item value datatype.

Wikibase::Datatype::Value::Monolingual

Wikibase monolingual value datatype.

Wikibase::Datatype::Value::String

Wikibase string value datatype.

Wikibase::Datatype::Value::Time

Wikibase time value datatype.

REPOSITORY

https://github.com/michal-josef-spacek/Wikibase-Datatype

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© Michal Josef Špaček 2020-2022

BSD 2-Clause License

VERSION

0.16