NAME

Wikibase::Datatype::Print::MediainfoSnak - Wikibase mediainfo snak pretty print helpers.

SYNOPSIS

use Wikibase::Datatype::Print::MediainfoSnak qw(print);

my $pretty_print_string = print($obj, $opts_hr);
my @pretty_print_lines = print($obj, $opts_hr);

SUBROUTINES

print

my $pretty_print_string = print($obj, $opts_hr);
my @pretty_print_lines = print($obj, $opts_hr);

Construct pretty print output for Wikibase::Datatype::MediainfoSnak object.

Returns string in scalar context. Returns list of lines in array context.

ERRORS

print():
        Object isn't 'Wikibase::Datatype::MediainfoSnak'.
        Bad snaktype.
                snaktype: %s

EXAMPLE1

use strict;
use warnings;

use Wikibase::Datatype::Print::MediainfoSnak;
use Wikibase::Datatype::MediainfoSnak;
use Wikibase::Datatype::Value::Item;

# Object.
my $obj = Wikibase::Datatype::MediainfoSnak->new(
        'datavalue' => Wikibase::Datatype::Value::Item->new(
                'value' => 'Q5',
        ),
        'property' => 'P31',
);

# Print.
print Wikibase::Datatype::Print::MediainfoSnak::print($obj)."\n";

# Output:
# P31: Q5

EXAMPLE2

use strict;
use warnings;

use Wikibase::Cache;
use Wikibase::Cache::Backend::Basic;
use Wikibase::Datatype::Print::MediainfoSnak;
use Wikibase::Datatype::MediainfoSnak;
use Wikibase::Datatype::Value::Item;

# Object.
my $obj = Wikibase::Datatype::MediainfoSnak->new(
        'datavalue' => Wikibase::Datatype::Value::Item->new(
                'value' => 'Q5',
        ),
        'property' => 'P31',
);

# Cache.
my $cache = Wikibase::Cache->new(
        'backend' => 'Basic',
);

# Print.
print Wikibase::Datatype::Print::MediainfoSnak::print($obj, {
        'cache' => $cache,
})."\n";

# Output:
# P31 (instance of): Q5

DEPENDENCIES

Error::Pure, Exporter, Readonly, Wikibase::Datatype::Print::Value.

SEE ALSO

Wikibase::Datatype::MediainfoSnak

Wikibase mediainfo snak datatype.

REPOSITORY

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

AUTHOR

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

http://skim.cz

LICENSE AND COPYRIGHT

© 2020-2023 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.16