File Coverage

blib/lib/Locale/ID/Province.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 19 19 100.0


line stmt bran cond sub pod time code
1             package Locale::ID::Province;
2              
3 1     1   25172 use 5.010001;
  1         3  
4 1     1   6 use strict;
  1         2  
  1         21  
5 1     1   5 use warnings;
  1         2  
  1         32  
6 1     1   1179 use Perinci::Sub::Gen::AccessTable 0.14 qw(gen_read_table_func);
  1         233329  
  1         77  
7              
8 1     1   11 use Exporter;
  1         1  
  1         569  
9             our @ISA = qw(Exporter);
10             our @EXPORT_OK = qw(
11             list_id_provinces
12             );
13              
14             our %SPEC;
15              
16             our $VERSION = '0.09'; # VERSION
17             our $DATE = '2015-09-03'; # DATE
18              
19             # BEGIN FRAGMENT id=meta
20             # note: This section is generated by a script. Do not edit manually!
21             # src-file: /mnt/home/s1/repos/gudang-data-interim/data/ind_province/meta.yaml
22             # src-revision: ef541a181f42b5ff05eb93f11df3478d75c99bdb
23             # revision-date: Fri Mar 23 11:23:36 2012 +0700
24             # generate-date: Fri Mar 23 14:19:31 2012
25             # generated-by: /mnt/home/s1/repos/gudang-data-interim/bin/gen-perl-meta-snippet
26             our $meta = {
27             "fields" => {
28             bps_code => {
29             "index" => 0,
30             "schema" => ["int*", { max => 99, min => 11 }],
31             "sortable" => 1,
32             "summary" => "BPS code",
33             "summary.alt.lang.id_ID" => "Kode BPS",
34             "unique" => 1,
35             },
36             eng_name => {
37             "index" => 3,
38             "schema" => ["str*", {}],
39             "sortable" => 1,
40             "summary" => "Name (in English)",
41             "summary.alt.lang.id_ID" => "Nama (bahasa Inggris)",
42             "unique" => 1,
43             },
44             ind_capital_name => {
45             "index" => 4,
46             "note" => "TODO link to locality_id",
47             "schema" => ["str*"],
48             "sortable" => 1,
49             "summary" => "Capital name (Indonesian)",
50             "summary.alt.lang.id_ID" => "Nama ibukota (bahasa Indonesia)",
51             },
52             ind_island_name => {
53             "index" => 5,
54             "note" => "TODO link to island_id",
55             "schema" => ["str*", {}],
56             "summary" => "Island (Indonesian)",
57             "summary.alt.lang.id_ID" => "Pulau",
58             },
59             ind_name => {
60             "index" => 2,
61             "schema" => ["str*", {}],
62             "sortable" => 1,
63             "summary" => "Name (in Indonesian)",
64             "summary.alt.lang.id_ID" => "Nama (bahasa Indonesia)",
65             "unique" => 1,
66             },
67             iso3166_2_code => {
68             "index" => 1,
69             "schema" => ["str*", { match => "^[A-Z]{2}-[A-Z]{2}\$" }],
70             "sortable" => 1,
71             "summary" => "ISO 3166-2 code",
72             "summary.alt.lang.id_ID" => "Kode ISO 3166-2",
73             "unique" => 1,
74             },
75             tags => {
76             "index" => 6,
77             "schema" => ["str*"],
78             "summary" => "Tag",
79             "summary.alt.lang.id_ID" => "Tag",
80             },
81             },
82             "pk" => "ind_name",
83             "summary" => "Provinces in Indonesia",
84             "summary.alt.lang.id_ID" => "Provinsi di Indonesia",
85             "table_aliases.alt.lang.id_ID" => ["provinsi_ind"],
86             }
87             ;
88             # END FRAGMENT id=meta
89             # BEGIN FRAGMENT id=data
90             # note: This section is generated by a script. Do not edit manually!
91             # src-file: /mnt/home/s1/repos/gudang-data-interim/data/ind_province/data.csv
92             # src-revision: a2f04185d567a2df0b6020b10189a5c060d22700
93             # revision-date: Wed Dec 14 12:57:27 2011 +0700
94             # generate-date: Fri Mar 23 14:19:31 2012
95             # generated-by: /mnt/home/s1/repos/gudang-data-interim/bin/gen-perl-data-snippet
96             our $data = [
97             ['11','ID-AC','Aceh','Aceh','Banda Aceh','Sumatera','special territory'],
98             ['12','ID-SU','Sumatera Utara','North Sumatra','Medan','Sumatera',''],
99             ['13','ID-SB','Sumatera Barat','West Sumatra','Padang','Sumatera',''],
100             ['14','ID-RI','Riau','Riau','Pekanbaru','Sumatera',''],
101             ['15','ID-JA','Jambi','Jambi','Jambi','Sumatera',''],
102             ['16','ID-SS','Sumatera Selatan','South Sumatra','Palembang','Sumatera',''],
103             ['17','ID-BE','Bengkulu','Bengkulu','Bengkulu','Sumatera',''],
104             ['18','ID-LA','Lampung','Lampung','Bandar Lampung','Sumatera',''],
105             ['19','ID-BB','Kepulauan Bangka Belitung','Bangka Belitung Islands','Pangkal Pinang','Sumatera',''],
106             ['21','ID-KR','Kepulauan Riau','Riau Islands','Tanjung Pinang','Sumatera',''],
107             ['31','ID-JK','Daerah Khusus Ibukota Jakarta','Jakarta Special Capital Territory','Jakarta Pusat','Jawa','special territory,special capital territory,capital'],
108             ['32','ID-JB','Jawa Barat','West Java','Bandung','Jawa',''],
109             ['33','ID-JT','Jawa Tengah','Central Java','Semarang','Jawa',''],
110             ['34','ID-YO','Daerah Istimewa Yogyakarta','Yogyakarta Special Territory','Yogyakarta','Jawa','special territory'],
111             ['35','ID-JI','Jawa Timur','East Java','Surabaya','Jawa',''],
112             ['36','ID-BT','Banten','Banten','Serang','Jawa',''],
113             ['51','ID-BA','Bali','Bali','Denpasar','Bali',''],
114             ['52','ID-NB','Nusa Tenggara Barat','West Nusa Tenggara','Mataram','Nusa Tenggara',''],
115             ['53','ID-NT','Nusa Tenggara Timur','East Nusa Tenggara','Kupang','Nusa Tenggara',''],
116             ['61','ID-KB','Kalimantan Barat','West Kalimantan','Pontianak','Kalimantan',''],
117             ['62','ID-KT','Kalimantan Tengah','Central Kalimantan','Palangkaraya','Kalimantan',''],
118             ['63','ID-KS','Kalimantan Selatan','South Kalimantan','Banjarmasin','Kalimantan',''],
119             ['64','ID-KI','Kalimantan Timur','East Kalimantan','Samarinda','Kalimantan',''],
120             ['71','ID-SA','Sulawesi Utara','North Sulawesi','Manado','Sulawesi',''],
121             ['72','ID-ST','Sulawesi Tengah','Central Sulawesi','Palu','Sulawesi',''],
122             ['73','ID-SN','Sulawesi Selatan','South Sulawesi','Makassar','Sulawesi',''],
123             ['74','ID-SG','Sulawesi Tenggara','South East Sulawesi','Kendari','Sulawesi',''],
124             ['75','ID-GO','Gorontalo','Gorontalo','Gorontalo','Sulawesi',''],
125             ['76','ID-SR','Sulawesi Barat','West Sulawesi','Mamuju','Sulawesi',''],
126             ['81','ID-MA','Maluku','Maluku','Ambon','Maluku',''],
127             ['82','ID-MU','Maluku Utara','North Maluku','Sofifi','Maluku',''],
128             ['91','ID-PB','Papua Barat','West Papua','Manokwari','Papua','special territory'],
129             ['94','ID-PA','Papua','Papua','Jayapura','Papua','special territory'],
130             ]
131             ;
132             # END FRAGMENT id=data
133              
134             my $res = gen_read_table_func(
135             name => 'list_id_provinces',
136             table_data => $data,
137             table_spec => $meta,
138             langs => ['en_US', 'id_ID'],
139             );
140             die "BUG: Can't generate func: $res->[0] - $res->[1]" unless $res->[0] == 200;
141              
142             1;
143             # ABSTRACT: List of provinces in Indonesia
144              
145             __END__
146              
147             =pod
148              
149             =encoding UTF-8
150              
151             =head1 NAME
152              
153             Locale::ID::Province - List of provinces in Indonesia
154              
155             =head1 VERSION
156              
157             This document describes version 0.09 of Locale::ID::Province (from Perl distribution Locale-ID-Province), released on 2015-09-03.
158              
159             =head1 SYNOPSIS
160              
161             use Locale::ID::Province qw(list_id_provinces);
162             my $res = list_id_provinces();
163              
164             =head1 DESCRIPTION
165              
166             This module provides API access for list of provinces in Indonesia. Data is
167             currently retrieved from the B<gudang-data-interim> repository at
168             https://github.com/sharyanto/gudang-data-interim/tree/master/data/ind_province/
169              
170             This module's functions has L<Rinci> specs.
171              
172             =head1 FUNCTIONS
173              
174              
175             =head2 list_id_provinces(%args) -> [status, msg, result, meta]
176              
177             Provinces in Indonesia.
178              
179             REPLACE ME
180              
181             Arguments ('*' denotes required arguments):
182              
183             =over 4
184              
185             =item * B<bps_code> => I<int>
186              
187             Only return records where the 'bps_code' field equals specified value.
188              
189             =item * B<bps_code.in> => I<array[int]>
190              
191             Only return records where the 'bps_code' field is in the specified values.
192              
193             =item * B<bps_code.is> => I<int>
194              
195             Only return records where the 'bps_code' field equals specified value.
196              
197             =item * B<bps_code.isnt> => I<int>
198              
199             Only return records where the 'bps_code' field does not equal specified value.
200              
201             =item * B<bps_code.max> => I<int>
202              
203             Only return records where the 'bps_code' field is less than or equal to specified value.
204              
205             =item * B<bps_code.min> => I<int>
206              
207             Only return records where the 'bps_code' field is greater than or equal to specified value.
208              
209             =item * B<bps_code.not_in> => I<array[int]>
210              
211             Only return records where the 'bps_code' field is not in the specified values.
212              
213             =item * B<bps_code.xmax> => I<int>
214              
215             Only return records where the 'bps_code' field is less than specified value.
216              
217             =item * B<bps_code.xmin> => I<int>
218              
219             Only return records where the 'bps_code' field is greater than specified value.
220              
221             =item * B<detail> => I<bool> (default: 0)
222              
223             Return array of full records instead of just ID fields.
224              
225             By default, only the key (ID) field is returned per result entry.
226              
227             =item * B<eng_name> => I<str>
228              
229             Only return records where the 'eng_name' field equals specified value.
230              
231             =item * B<eng_name.contains> => I<str>
232              
233             Only return records where the 'eng_name' field contains specified text.
234              
235             =item * B<eng_name.in> => I<array[str]>
236              
237             Only return records where the 'eng_name' field is in the specified values.
238              
239             =item * B<eng_name.is> => I<str>
240              
241             Only return records where the 'eng_name' field equals specified value.
242              
243             =item * B<eng_name.isnt> => I<str>
244              
245             Only return records where the 'eng_name' field does not equal specified value.
246              
247             =item * B<eng_name.max> => I<str>
248              
249             Only return records where the 'eng_name' field is less than or equal to specified value.
250              
251             =item * B<eng_name.min> => I<str>
252              
253             Only return records where the 'eng_name' field is greater than or equal to specified value.
254              
255             =item * B<eng_name.not_contains> => I<str>
256              
257             Only return records where the 'eng_name' field does not contain specified text.
258              
259             =item * B<eng_name.not_in> => I<array[str]>
260              
261             Only return records where the 'eng_name' field is not in the specified values.
262              
263             =item * B<eng_name.xmax> => I<str>
264              
265             Only return records where the 'eng_name' field is less than specified value.
266              
267             =item * B<eng_name.xmin> => I<str>
268              
269             Only return records where the 'eng_name' field is greater than specified value.
270              
271             =item * B<fields> => I<array[str]>
272              
273             Select fields to return.
274              
275             =item * B<ind_capital_name> => I<str>
276              
277             Only return records where the 'ind_capital_name' field equals specified value.
278              
279             =item * B<ind_capital_name.contains> => I<str>
280              
281             Only return records where the 'ind_capital_name' field contains specified text.
282              
283             =item * B<ind_capital_name.in> => I<array[str]>
284              
285             Only return records where the 'ind_capital_name' field is in the specified values.
286              
287             =item * B<ind_capital_name.is> => I<str>
288              
289             Only return records where the 'ind_capital_name' field equals specified value.
290              
291             =item * B<ind_capital_name.isnt> => I<str>
292              
293             Only return records where the 'ind_capital_name' field does not equal specified value.
294              
295             =item * B<ind_capital_name.max> => I<str>
296              
297             Only return records where the 'ind_capital_name' field is less than or equal to specified value.
298              
299             =item * B<ind_capital_name.min> => I<str>
300              
301             Only return records where the 'ind_capital_name' field is greater than or equal to specified value.
302              
303             =item * B<ind_capital_name.not_contains> => I<str>
304              
305             Only return records where the 'ind_capital_name' field does not contain specified text.
306              
307             =item * B<ind_capital_name.not_in> => I<array[str]>
308              
309             Only return records where the 'ind_capital_name' field is not in the specified values.
310              
311             =item * B<ind_capital_name.xmax> => I<str>
312              
313             Only return records where the 'ind_capital_name' field is less than specified value.
314              
315             =item * B<ind_capital_name.xmin> => I<str>
316              
317             Only return records where the 'ind_capital_name' field is greater than specified value.
318              
319             =item * B<ind_island_name> => I<str>
320              
321             Only return records where the 'ind_island_name' field equals specified value.
322              
323             =item * B<ind_island_name.contains> => I<str>
324              
325             Only return records where the 'ind_island_name' field contains specified text.
326              
327             =item * B<ind_island_name.in> => I<array[str]>
328              
329             Only return records where the 'ind_island_name' field is in the specified values.
330              
331             =item * B<ind_island_name.is> => I<str>
332              
333             Only return records where the 'ind_island_name' field equals specified value.
334              
335             =item * B<ind_island_name.isnt> => I<str>
336              
337             Only return records where the 'ind_island_name' field does not equal specified value.
338              
339             =item * B<ind_island_name.max> => I<str>
340              
341             Only return records where the 'ind_island_name' field is less than or equal to specified value.
342              
343             =item * B<ind_island_name.min> => I<str>
344              
345             Only return records where the 'ind_island_name' field is greater than or equal to specified value.
346              
347             =item * B<ind_island_name.not_contains> => I<str>
348              
349             Only return records where the 'ind_island_name' field does not contain specified text.
350              
351             =item * B<ind_island_name.not_in> => I<array[str]>
352              
353             Only return records where the 'ind_island_name' field is not in the specified values.
354              
355             =item * B<ind_island_name.xmax> => I<str>
356              
357             Only return records where the 'ind_island_name' field is less than specified value.
358              
359             =item * B<ind_island_name.xmin> => I<str>
360              
361             Only return records where the 'ind_island_name' field is greater than specified value.
362              
363             =item * B<ind_name> => I<str>
364              
365             Only return records where the 'ind_name' field equals specified value.
366              
367             =item * B<ind_name.contains> => I<str>
368              
369             Only return records where the 'ind_name' field contains specified text.
370              
371             =item * B<ind_name.in> => I<array[str]>
372              
373             Only return records where the 'ind_name' field is in the specified values.
374              
375             =item * B<ind_name.is> => I<str>
376              
377             Only return records where the 'ind_name' field equals specified value.
378              
379             =item * B<ind_name.isnt> => I<str>
380              
381             Only return records where the 'ind_name' field does not equal specified value.
382              
383             =item * B<ind_name.max> => I<str>
384              
385             Only return records where the 'ind_name' field is less than or equal to specified value.
386              
387             =item * B<ind_name.min> => I<str>
388              
389             Only return records where the 'ind_name' field is greater than or equal to specified value.
390              
391             =item * B<ind_name.not_contains> => I<str>
392              
393             Only return records where the 'ind_name' field does not contain specified text.
394              
395             =item * B<ind_name.not_in> => I<array[str]>
396              
397             Only return records where the 'ind_name' field is not in the specified values.
398              
399             =item * B<ind_name.xmax> => I<str>
400              
401             Only return records where the 'ind_name' field is less than specified value.
402              
403             =item * B<ind_name.xmin> => I<str>
404              
405             Only return records where the 'ind_name' field is greater than specified value.
406              
407             =item * B<iso3166_2_code> => I<str>
408              
409             Only return records where the 'iso3166_2_code' field equals specified value.
410              
411             =item * B<iso3166_2_code.contains> => I<str>
412              
413             Only return records where the 'iso3166_2_code' field contains specified text.
414              
415             =item * B<iso3166_2_code.in> => I<array[str]>
416              
417             Only return records where the 'iso3166_2_code' field is in the specified values.
418              
419             =item * B<iso3166_2_code.is> => I<str>
420              
421             Only return records where the 'iso3166_2_code' field equals specified value.
422              
423             =item * B<iso3166_2_code.isnt> => I<str>
424              
425             Only return records where the 'iso3166_2_code' field does not equal specified value.
426              
427             =item * B<iso3166_2_code.max> => I<str>
428              
429             Only return records where the 'iso3166_2_code' field is less than or equal to specified value.
430              
431             =item * B<iso3166_2_code.min> => I<str>
432              
433             Only return records where the 'iso3166_2_code' field is greater than or equal to specified value.
434              
435             =item * B<iso3166_2_code.not_contains> => I<str>
436              
437             Only return records where the 'iso3166_2_code' field does not contain specified text.
438              
439             =item * B<iso3166_2_code.not_in> => I<array[str]>
440              
441             Only return records where the 'iso3166_2_code' field is not in the specified values.
442              
443             =item * B<iso3166_2_code.xmax> => I<str>
444              
445             Only return records where the 'iso3166_2_code' field is less than specified value.
446              
447             =item * B<iso3166_2_code.xmin> => I<str>
448              
449             Only return records where the 'iso3166_2_code' field is greater than specified value.
450              
451             =item * B<query> => I<str>
452              
453             Search.
454              
455             =item * B<random> => I<bool> (default: 0)
456              
457             Return records in random order.
458              
459             =item * B<result_limit> => I<int>
460              
461             Only return a certain number of records.
462              
463             =item * B<result_start> => I<int> (default: 1)
464              
465             Only return starting from the n'th record.
466              
467             =item * B<sort> => I<str>
468              
469             Order records according to certain field(s).
470              
471             A list of field names separated by comma. Each field can be prefixed with '-' to
472             specify descending order instead of the default ascending.
473              
474             =item * B<tags> => I<str>
475              
476             Only return records where the 'tags' field equals specified value.
477              
478             =item * B<tags.contains> => I<str>
479              
480             Only return records where the 'tags' field contains specified text.
481              
482             =item * B<tags.in> => I<array[str]>
483              
484             Only return records where the 'tags' field is in the specified values.
485              
486             =item * B<tags.is> => I<str>
487              
488             Only return records where the 'tags' field equals specified value.
489              
490             =item * B<tags.isnt> => I<str>
491              
492             Only return records where the 'tags' field does not equal specified value.
493              
494             =item * B<tags.max> => I<str>
495              
496             Only return records where the 'tags' field is less than or equal to specified value.
497              
498             =item * B<tags.min> => I<str>
499              
500             Only return records where the 'tags' field is greater than or equal to specified value.
501              
502             =item * B<tags.not_contains> => I<str>
503              
504             Only return records where the 'tags' field does not contain specified text.
505              
506             =item * B<tags.not_in> => I<array[str]>
507              
508             Only return records where the 'tags' field is not in the specified values.
509              
510             =item * B<tags.xmax> => I<str>
511              
512             Only return records where the 'tags' field is less than specified value.
513              
514             =item * B<tags.xmin> => I<str>
515              
516             Only return records where the 'tags' field is greater than specified value.
517              
518             =item * B<with_field_names> => I<bool>
519              
520             Return field names in each record (as hash/associative array).
521              
522             When enabled, function will return each record as hash/associative array
523             (field name => value pairs). Otherwise, function will return each record
524             as list/array (field value, field value, ...).
525              
526             =back
527              
528             Returns an enveloped result (an array).
529              
530             First element (status) is an integer containing HTTP status code
531             (200 means OK, 4xx caller error, 5xx function error). Second element
532             (msg) is a string containing error message, or 'OK' if status is
533             200. Third element (result) is optional, the actual result. Fourth
534             element (meta) is called result metadata and is optional, a hash
535             that contains extra information.
536              
537             Return value: (any)
538              
539             =head1 SEE ALSO
540              
541             L<list-id-provinces>
542              
543             Gudang Data Interim project, https://github.com/sharyanto/gudang-data-interim/
544              
545             This API will also be available on GudangAPI, http://gudangapi.com/
546              
547             =head1 HOMEPAGE
548              
549             Please visit the project's homepage at L<https://metacpan.org/release/Locale-ID-Province>.
550              
551             =head1 SOURCE
552              
553             Source repository is at L<https://github.com/perlancar/perl-Locale-ID-Province>.
554              
555             =head1 BUGS
556              
557             Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Locale-ID-Province>
558              
559             When submitting a bug or request, please include a test-file or a
560             patch to an existing test-file that illustrates the bug or desired
561             feature.
562              
563             =head1 AUTHOR
564              
565             perlancar <perlancar@cpan.org>
566              
567             =head1 COPYRIGHT AND LICENSE
568              
569             This software is copyright (c) 2015 by perlancar@cpan.org.
570              
571             This is free software; you can redistribute it and/or modify it under
572             the same terms as the Perl 5 programming language system itself.
573              
574             =cut