Commit 13b9dcdf authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Rename to Travel::Routing::DE::VRR

parent 2a1d17f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ my %opts = (
		'Test::Pod' => 0,
		'Test::Command' => 0,
	},
	module_name => 'Net::Travel::DE::VRR',
	module_name => 'Travel::Routing::DE::VRR',
	license => 'unrestricted',
	requires => {
		'Class::Accessor' => 0,
+11 −11
Original line number Diff line number Diff line
package Net::Travel::DE::VRR;
package Travel::Routing::DE::VRR;

use strict;
use warnings;
use 5.010;

use Carp qw(confess);
use Net::Travel::DE::VRR::Route;
use Travel::Routing::DE::VRR::Route;
use LWP::UserAgent;
use XML::LibXML;

@@ -421,7 +421,7 @@ sub parse_pretty {
		push( @elements, $hash );
	}

	return Net::Travel::DE::VRR::Route->new(@elements);
	return Travel::Routing::DE::VRR::Route->new(@elements);
}

sub new {
@@ -531,13 +531,13 @@ __END__

=head1 NAME

Net::Travel::DE::VRR - inofficial interface to the efa.vrr.de German itinerary service
Travel::Routing::DE::VRR - inofficial interface to the efa.vrr.de German itinerary service

=head1 SYNOPSIS

	use Net::Travel::DE::VRR;
	use Travel::Routing::DE::VRR;

	my $efa = Net::Travel::DE::VRR->new(
	my $efa = Travel::Routing::DE::VRR->new(
		origin      => [ 'Essen',    'HBf' ],
		destination => [ 'Duisburg', 'HBf' ],
	);
@@ -562,7 +562,7 @@ version 1.3

=head1 DESCRIPTION

B<Net::Travel::DE::VRR> is a client for the efa.vrr.de web interface.
B<Travel::Routing::DE::VRR> is a client for the efa.vrr.de web interface.
You pass it the start/stop of your journey, maybe a time and a date and more
details, and it returns the up-to-date scheduled connections between those two
stops.
@@ -573,9 +573,9 @@ It uses B<LWP::USerAgent> and B<XML::LibXML> for this.

=over

=item $efa = Net::Travel::DE::VRR->new(I<%conf>)
=item $efa = Travel::Routing::DE::VRR->new(I<%conf>)

Returns a new Net::Travel::DE::VRR object and sets up its POST data via %conf.
Returns a new Travel::Routing::DE::VRR object and sets up its POST data via %conf.

Valid hash keys and their values are:

@@ -650,7 +650,7 @@ I<%opts> is passed on to C<< LWP::UserAgent->new(%opts) >>.

=item $efa->routes()

Returns a list of Net::Travel::DE::VRR::Route(3pm) elements. Each one contains
Returns a list of Travel::Routing::DE::VRR::Route(3pm) elements. Each one contains
one method of getting from start to stop.

=back
@@ -701,7 +701,7 @@ Dies with a backtrace when anything goes wrong.

The parser is still somewhat fragile and has no proper error handling.

It is best not to pass Unicode characters to B<Net::Travel::DE::VRR>.
It is best not to pass Unicode characters to B<Travel::Routing::DE::VRR>.

=head1 AUTHOR

+12 −12
Original line number Diff line number Diff line
package Net::Travel::DE::VRR::Route;
package Travel::Routing::DE::VRR::Route;

use strict;
use warnings;
use 5.010;

use Net::Travel::DE::VRR::Route::Part;
use Travel::Routing::DE::VRR::Route::Part;

our $VERSION = '1.3';

@@ -16,7 +16,7 @@ sub new {
	for my $part (@parts) {
		push(
			@{ $ref->{parts} },
			Net::Travel::DE::VRR::Route::Part->new( %{$part} )
			Travel::Routing::DE::VRR::Route::Part->new( %{$part} )
		);
	}

@@ -35,13 +35,13 @@ __END__

=head1 NAME

Net::Travel::DE::VRR::Route - Single route (connection) between two points
Travel::Routing::DE::VRR::Route - Single route (connection) between two points

=head1 SYNOPSIS

	for my $route ( $efa->routes() ) {
		for my $part ( $route->parts() ) {
			# $part is a Net::Travel::DE::VRR::Route::Part object
			# $part is a Travel::Routing::DE::VRR::Route::Part object
		}
	}

@@ -51,8 +51,8 @@ version 1.3

=head1 DESCRIPTION

Net::Travel::DE::VRR::Route describes a single method of getting from one
point to another.  It holds a bunch of Net::Travel::DE::VRR::Route::Part(3pm)
Travel::Routing::DE::VRR::Route describes a single method of getting from one
point to another.  It holds a bunch of Travel::Routing::DE::VRR::Route::Part(3pm)
objects describing the parts of the route in detail.  Each part depends on the
previous one.

@@ -62,14 +62,14 @@ You usually want to acces it via C<< $efa->routes() >>.

=over

=item my $route = Net::Travel::DE::VRR::Route->new(I<@parts>)
=item my $route = Travel::Routing::DE::VRR::Route->new(I<@parts>)

Creates a new Net::Travel::DE::VRR::Route elements consisting of I<parts>,
which are Net::Travel::DE::VRR::Route::Part elements.
Creates a new Travel::Routing::DE::VRR::Route elements consisting of I<parts>,
which are Travel::Routing::DE::VRR::Route::Part elements.

=item $route->parts()

Returns a list of Net::Travel::DE::VRR::Route::Part(3pm) elements describing
Returns a list of Travel::Routing::DE::VRR::Route::Part(3pm) elements describing
the actual route.

=back
@@ -88,7 +88,7 @@ None known.

=head1 SEE ALSO

Net::Travel::DE::VRR(3pm), Net::Travel::DE::VRR::Route::Part(3pm).
Travel::Routing::DE::VRR(3pm), Travel::Routing::DE::VRR::Route::Part(3pm).

=head1 AUTHOR

+8 −8
Original line number Diff line number Diff line
package Net::Travel::DE::VRR::Route::Part;
package Travel::Routing::DE::VRR::Route::Part;

use strict;
use warnings;
@@ -8,7 +8,7 @@ use parent 'Class::Accessor';

our $VERSION = '1.3';

Net::Travel::DE::VRR::Route::Part->mk_ro_accessors(
Travel::Routing::DE::VRR::Route::Part->mk_ro_accessors(
	qw(arrival_stop arrival_time departure_stop departure_time train_line
	  train_destination)
);
@@ -33,7 +33,7 @@ __END__

=head1 NAME

Net::Travel::DE::VRR::Route::Part - Describes one connection between two
Travel::Routing::DE::VRR::Route::Part - Describes one connection between two
points, without interchanges

=head1 SYNOPSIS
@@ -58,20 +58,20 @@ version 0.3

=head1 DESCRIPTION

B<Net::Travel::DE::VRR::Route::Part> holds one specific connection (without
B<Travel::Routing::DE::VRR::Route::Part> holds one specific connection (without
interchanges) between two points.  It specifies the start/stop point and time,
the train line and its destination, and optional additional data.

It is usually obtained by a call to Net::Travel::DE::VRR::Route(3pm)'s
It is usually obtained by a call to Travel::Routing::DE::VRR::Route(3pm)'s
B<parts> method.

=head1 METHODS

=over

=item $part = Net::Travel::DE::VRR::Route::Part->new(I<%data>)
=item $part = Travel::Routing::DE::VRR::Route::Part->new(I<%data>)

Creates a new Net::Travel::DE::VRR::Route::Part object. I<data> consists of:
Creates a new Travel::Routing::DE::VRR::Route::Part object. I<data> consists of:

=over

@@ -139,7 +139,7 @@ None known.

=head1 SEE ALSO

Net::Travel::DE::VRR(3pm).
Travel::Routing::DE::VRR(3pm).

=head1 AUTHOR

+3 −3
Original line number Diff line number Diff line
@@ -6,9 +6,9 @@ use 5.010;
use Test::More tests => 59;

BEGIN {
	use_ok('Net::Travel::DE::VRR');
	use_ok('Travel::Routing::DE::VRR');
}
require_ok('Net::Travel::DE::VRR');
require_ok('Travel::Routing::DE::VRR');

sub efa_conf {
	my $ret = {
@@ -23,7 +23,7 @@ sub efa_conf {

sub efa_new {
	return new_ok(
		'Net::Travel::DE::VRR' => [%{efa_conf(@_)}]
		'Travel::Routing::DE::VRR' => [%{efa_conf(@_)}]
	);
}