Also fix a few typos.
Signed-off-by: Jason Stephenson <jason@sigio.com>
# The fields are as defined in Z39.83-1-2012. Ext is provided but is
# not used by the current iteration of NCIPServer.
-NCIP::Problem->mk_accessors(qw(FromSystemId FromSystemAuthentication
+NCIP::Header->mk_accessors(qw(FromSystemId FromSystemAuthentication
FromAgencyId FromAgencyAuthentication
ToSystemId ToAgencyId Ext));
# ---------------------------------------------------------------
package NCIP::ILS;
+use Modern::Perl;
+use NCIP::Const;
+use NCIP::Header;
+use NCIP::Response;
+
sub new {
my $invocant = shift;
my $class = ref $invocant || $invocant;
# Handle a LookupVersion Request. You probably want to just call this
# one from your subclasses rather than reimplement it.
sub lookupversion {
+ my $self = shift;
+ my $request = shift;
+
+ my $response = NCIP::Response->new({type => "LookupVersionResponse"});
+ $response->header($self->make_header($request));
+ my $payload = {
+ versions => [ NCIP::Const::SUPPORTED_VERSIONS ]
+ };
+ $response->data($payload);
+
+ return $response;
}
# A few helper methods:
# supplied the other must be left undefined/unset. Only 1 header is
# supported, but it is entirely optional according to the standard.
-NCIP::Problem->mk_accessors(qw(type data problem header));
+NCIP::Response->mk_accessors(qw(type data problem header));
1;