Bio-Biblio
view release on metacpan or search on metacpan
lib/Bio/Biblio/BiblioBase.pm view on Meta::CPAN
return $self;
}
sub _wrong_type_msg {
my ($self, $given_type, $expected_type, $method) = @_;
my $msg = 'In method ';
if (defined $method) {
$msg .= $method;
} else {
$msg .= (caller(1))[3];
}
return ("$msg: Trying to set a value of type '$given_type' but '$expected_type' is expected.");
}
sub print_me {
my ($self) = @_;
require Data::Dumper;
return Data::Dumper->Dump ( [$self], ['Citation']);
}
lib/Bio/DB/Biblio/soap.pm view on Meta::CPAN
}
}
#
# some methods must be called with an argument containing a collection
# ID; here we return a proper error message explaining it
#
sub _no_id_msg {
my $self = shift;
my $package = ref $self;
my $method = (caller(1))[3];
my $strip_method = $method;
$strip_method =~ s/^$package\:\://;
return <<"END_OF_MSG";
Method '$method' works only if its object has a query collection ID.
Perhaps you need to use:
\tBio::Biblio->new(-collection_id => '1234567')->$strip_method;
or to obtain a collection ID indirectly from a query method:
\tBio::Biblio->new->find ('keyword')->$strip_method;
END_OF_MSG
}
#
# some methods do not work with older SOAP::Lite version; here we
#return message explaining it
#
sub _old_version_msg {
my $self = shift;
my $method = (caller(1))[3];
return <<"END_OF_MSG";
Method '$method' works only with SOAP::Lite
version 0.52 and newer (the problem is with returning a boolean value from the server).
END_OF_MSG
}
#
# some controlled vocabulary methods needs two parameters; here we
# return message explaining it
#
sub _two_params_msg {
my $self = shift;
my $method = (caller(1))[3];
return <<"END_OF_MSG";
Method '$method' expects two parameters: vocabulary name and a value.
END_OF_MSG
}
#
# some controlled vocabulary methods needs a vocabulary name; here we
# return message explaining it
#
sub _missing_name_msg {
my $self = shift;
my $method = (caller(1))[3];
return <<"END_OF_MSG";
Method '$method' expects vocabulary name as parameter.
END_OF_MSG
}
#
# return a copy of a given array, with all its elements replaced
# with the SOAP-Data objects defining elements type as 'string'
#
( run in 0.270 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )