Yandex::Geo::Company - Convenient representation of company from Yandex Maps
version 0.05
Class that is more convenient realization of company
It has following properties:
id # yandex maps id name # name of company, type = string shortName # short name of company, type = string url # website of company, type = string phones # company numbers, type = arrayref links # links to pages on social networks, type = arrayref vk # link to vk, type = string address # location, type = str postalCode # postal code, type = str (6 digits)
Also, this class implements two methods: from_json and from_geo_json
If you make a query
my $yndx_geo = Yandex::Geosearch->new( apikey => 'f33a4523-6c94-48df-9b41-5c5c6f250e98'); my $res = $yndx_geo->get(text => 'макетные мастерские', only_city => 'ROV');
and process $res
$res
Yandex::Geo::Company->from_json( $res->to_json )
and
Yandex::Geo::Company->from_geo_json( $res )
do the same.
Yandex::Geo::Company::properties();
Detailed info about Yandex::Geo::Company properties
Return hashref with following keys:
set - list if all set properties names, regardless of type, in alphabetic order all - list if all available properties names, regardless of type, in alphabetic order string - list of all properties names with type = string array - list of all properties names with type = ARRAY
Accept Geo::JSON::FeatureCollection as $json and return array of Yandex::Geo::Company objects
$json
Yandex::Geo::Company::from_geo_json($json);
Parse regular json to arrayref of Yandex::Geo::Company objects
Yandex::Geo::Company::from_json($json);
Serialize object data to arrayref.
Can be useful when inserting data via modules like Text::CSV
Sequence is: id name shortName phones postalCode address longitude latitude url vk instagram links
id name shortName phones postalCode address longitude latitude url vk instagram links
phones, links are serialized, each element on new string
phones, links
Yandex::Geo::Company
use Yandex::Geo::Company; my $a = Yandex::Geo::Company->new ( name => 'Test LLC' ); warn $a->name; # 'Test LLC' warn $a->foo; # Can't locate object method "foo" via package "Yandex::Geo::Company" Yandex::Geo::Company::from_json( $res->to_json ) Yandex::Geo::Company::from_geo_json( $res )
Pavel Serikov <pavelsr@cpan.org>
This software is copyright (c) 2018 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 Yandex::Geo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Yandex::Geo
CPAN shell
perl -MCPAN -e shell install Yandex::Geo
For more information on module installation, please visit the detailed CPAN module installation guide.