WebService::CIA::Source - A base class for WebService::CIA sources


WebService-CIA documentation Contained in the WebService-CIA distribution.

Index


Code Index:

NAME

Top

WebService::CIA::Source - A base class for WebService::CIA sources

SYNOPSIS

Top

  use WebService::CIA::Source;
  my $source = WebService::CIA::Source->new();




DESCRIPTION

Top

WebService::CIA::Source is a base class for WebService::CIA sources, such as WebService::CIA::Source::DBM and WebService::CIA::Source::Web.

It could be used as a source in its own right, but it won't get you very far.

METHODS

Top

new()

This method creates a new WebService::CIA::Source object. It takes no arguments.

value($country_code, $field)

Retrieve a value. Always returns undef.

all($country_code)

Retrieve all fields and values. Always returns an empty hashref.

AUTHOR

Top

Ian Malpass (ian-cpan@indecorous.com)

COPYRIGHT

Top

SEE ALSO

Top

WebService::CIA, WebService::CIA::Parser, WebService::CIA::Source::DBM, WebService::CIA::Source::Web


WebService-CIA documentation Contained in the WebService-CIA distribution.

package WebService::CIA::Source;

require 5.005_62;
use strict;
use warnings;

our $VERSION = '1.4';


# Preloaded methods go here.

sub new {

    my $proto = shift;
    my $source = shift;
    my $class = ref($proto) || $proto;
    my $self = {};

    bless ($self, $class);
    return $self;

}

sub value {

    my $self = shift;
    my ($cc, $f) = @_;
    if ($cc eq 'testcountry' and $f eq 'Test') {
        return 'Wombat';
    } else {
        return;
    }

}

sub all {

    my $self = shift;
    my $cc = shift;
    if ($cc eq 'testcountry') {
        return {'Test' => 'Wombat'};
    } else {
        return {};
    }

}


1;
__END__