WWW::AzimuthAero::Flight - Flight representation
version 0.3
my $flight = WWW::AzimuthAero::Flight->new( from_city => 'ROV', to_city => 'KLF', flight_date => '16.06.2019' );
Object representation of data on pages like https://booking.azimuth.aero/!/ROV/LED/21.06.2019/1-0-0/
my $az = WWW::AzimuthAero::Flight->new(date => '16.06.2019', from => 'ROV', to => 'KLF');
Departure city IATA code
Example:
LED
Arrival city IATA code
ROV
Return string with flight number
A4 203
String in %d.%m.%Y format
24.06.2019
07:20
10:00
5ч 35м
Contain hash with different tariffs
{ 'lowest' => '10680', 'optimalnyy' => '10680', 'svobodnyy' => '11980' }
Possible keys are
qw/legkiy vygodnyy optimalnyy svobodnyy/
lowest key always contains lowest price
Return true if flight consist of two flights
Like at https://booking.azimuth.aero/!/ROV/PKV/26.06.2019/1-0-0/
Return IATA code of transit city
Return particular properties as hash
$f->as_hash; $f->as_hash( skip => [ qw/fares/ ] ) $flight->as_hash( only => [ qw/from_city to_city flight_date/ ] )
If class has such method but it's not set - will return undef in value
Convenient when inserting data to database, especially with DBIx::Class::ResultSet
$schema->resultset('Flight')->create( $f->as_hash( skip => [ qw/fares/ ] ) )
Params:
only - Which fields to return only
skip - Which fields skip from result = 'all except'
skip_undef - To skip or not undef values (useful to supress warning in concatenation)
Return flight info as string
Support same parameters as WWW::AzimuthAero::Flight (in facts it's wrapper on it)
$f->as_string; $f->as_string( skip => [ qw/fares/ ] ) $flight->as_string( only => [ qw/from_city to_city flight_date/ ] )
Additional parameters
order
$f->as_string( order => [ qw/price flight_date/ ] )
By default (in order not specified) prints parameters in alphabetic order
Method could be useful for logging
separator
$f->as_string( separator => "\t" )
Useful when you create a table
Pavel Serikov <pavelsr@cpan.org>
This software is copyright (c) 2019 by Pavel Serikov.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WWW::AzimuthAero, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::AzimuthAero
CPAN shell
perl -MCPAN -e shell install WWW::AzimuthAero
For more information on module installation, please visit the detailed CPAN module installation guide.