| 1 | package Wikibase::Datatype::Print::Value; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 44 | ▶ | use base qw(Exporter); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 44 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 44 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 44 | ▶ | use Error::Pure qw(err); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 44 | ▶ | use Readonly; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 44 | ▶ | use Wikibase::Datatype::Print::Value::Globecoordinate; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 44 | ▶ | use Wikibase::Datatype::Print::Value::Item; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 44 | ▶ | use Wikibase::Datatype::Print::Value::Lexeme; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 44 | ▶ | use Wikibase::Datatype::Print::Value::Monolingual; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 44 | ▶ | use Wikibase::Datatype::Print::Value::Property; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 44 | ▶ | use Wikibase::Datatype::Print::Value::Quantity; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 44 | ▶ | use Wikibase::Datatype::Print::Value::Sense; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 44 | ▶ | use Wikibase::Datatype::Print::Value::String; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 44 | ▶ | use Wikibase::Datatype::Print::Value::Time; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 44 | Readonly::Array our @EXPORT_OK => qw(print); | |||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 44 | our $VERSION = 0.21; | |||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 75 | ▶ | sub print { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
print: called CC=11 SCAR=24.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 75 | my ($obj, $opts_hr) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 75 | ▶ | if (! $obj->isa('Wikibase::Datatype::Value')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | err "Object isn't 'Wikibase::Datatype::Value'."; | |||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | 74 | my $type = $obj->type; | |||||||||||||||||||||||||||||||||||||||||
| 31 | 74 | my $ret; | |||||||||||||||||||||||||||||||||||||||||
| 32 | 74 | ▶ | if ($type eq 'globecoordinate') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 9 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | 1 | $ret = Wikibase::Datatype::Print::Value::Globecoordinate::print($obj, $opts_hr); | |||||||||||||||||||||||||||||||||||||||||
| 34 | } elsif ($type eq 'item') { | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 34 | $ret = Wikibase::Datatype::Print::Value::Item::print($obj, $opts_hr); | |||||||||||||||||||||||||||||||||||||||||
| 36 | } elsif ($type eq 'lexeme') { | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | $ret = Wikibase::Datatype::Print::Value::Lexeme::print($obj, $opts_hr); | |||||||||||||||||||||||||||||||||||||||||
| 38 | } elsif ($type eq 'monolingualtext') { | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 1 | $ret = Wikibase::Datatype::Print::Value::Monolingual::print($obj, $opts_hr); | |||||||||||||||||||||||||||||||||||||||||
| 40 | } elsif ($type eq 'property') { | ||||||||||||||||||||||||||||||||||||||||||
| 41 | 1 | $ret = Wikibase::Datatype::Print::Value::Property::print($obj, $opts_hr); | |||||||||||||||||||||||||||||||||||||||||
| 42 | } elsif ($type eq 'quantity') { | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 5 | $ret = Wikibase::Datatype::Print::Value::Quantity::print($obj, $opts_hr); | |||||||||||||||||||||||||||||||||||||||||
| 44 | } elsif ($type eq 'sense') { | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 1 | $ret = Wikibase::Datatype::Print::Value::Sense::print($obj, $opts_hr); | |||||||||||||||||||||||||||||||||||||||||
| 46 | } elsif ($type eq 'string') { | ||||||||||||||||||||||||||||||||||||||||||
| 47 | 24 | $ret = Wikibase::Datatype::Print::Value::String::print($obj, $opts_hr); | |||||||||||||||||||||||||||||||||||||||||
| 48 | } elsif ($type eq 'time') { | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 6 | $ret = Wikibase::Datatype::Print::Value::Time::print($obj, $opts_hr); | |||||||||||||||||||||||||||||||||||||||||
| 50 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 1 | err "Type '$type' is unsupported."; | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 73 | return $ret; | |||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | 44 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | __END__ | ||||||||||||||||||||||||||||||||||||||||||