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   63232 use 5.010001;
  1         4  
4 1     1   7 use strict;
  1         3  
  1         40  
5 1     1   6 use warnings;
  1         3  
  1         35  
6 1     1   890 use Perinci::Sub::Gen::AccessTable qw(gen_read_table_func);
  1         62724  
  1         120  
7              
8 1     1   18 use Exporter;
  1         4  
  1         683  
9             our @ISA = qw(Exporter);
10             our @EXPORT_OK = qw(
11             list_id_provinces
12             );
13              
14             our %SPEC;
15              
16             our $VERSION = '0.10'; # VERSION
17             our $DATE = '2017-07-10'; # 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.10 of Locale::ID::Province (from Perl distribution Locale-ID-Province), released on 2017-07-10.
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
176              
177             Usage:
178              
179             list_id_provinces(%args) -> [status, msg, result, meta]
180              
181             Provinces in Indonesia.
182              
183             REPLACE ME
184              
185             This function is not exported by default, but exportable.
186              
187             Arguments ('*' denotes required arguments):
188              
189             =over 4
190              
191             =item * B<bps_code> => I<int>
192              
193             Only return records where the 'bps_code' field equals specified value.
194              
195             =item * B<bps_code.in> => I<array[int]>
196              
197             Only return records where the 'bps_code' field is in the specified values.
198              
199             =item * B<bps_code.is> => I<int>
200              
201             Only return records where the 'bps_code' field equals specified value.
202              
203             =item * B<bps_code.isnt> => I<int>
204              
205             Only return records where the 'bps_code' field does not equal specified value.
206              
207             =item * B<bps_code.max> => I<int>
208              
209             Only return records where the 'bps_code' field is less than or equal to specified value.
210              
211             =item * B<bps_code.min> => I<int>
212              
213             Only return records where the 'bps_code' field is greater than or equal to specified value.
214              
215             =item * B<bps_code.not_in> => I<array[int]>
216              
217             Only return records where the 'bps_code' field is not in the specified values.
218              
219             =item * B<bps_code.xmax> => I<int>
220              
221             Only return records where the 'bps_code' field is less than specified value.
222              
223             =item * B<bps_code.xmin> => I<int>
224              
225             Only return records where the 'bps_code' field is greater than specified value.
226              
227             =item * B<detail> => I<bool> (default: 0)
228              
229             Return array of full records instead of just ID fields.
230              
231             By default, only the key (ID) field is returned per result entry.
232              
233             =item * B<eng_name> => I<str>
234              
235             Only return records where the 'eng_name' field equals specified value.
236              
237             =item * B<eng_name.contains> => I<str>
238              
239             Only return records where the 'eng_name' field contains specified text.
240              
241             =item * B<eng_name.in> => I<array[str]>
242              
243             Only return records where the 'eng_name' field is in the specified values.
244              
245             =item * B<eng_name.is> => I<str>
246              
247             Only return records where the 'eng_name' field equals specified value.
248              
249             =item * B<eng_name.isnt> => I<str>
250              
251             Only return records where the 'eng_name' field does not equal specified value.
252              
253             =item * B<eng_name.max> => I<str>
254              
255             Only return records where the 'eng_name' field is less than or equal to specified value.
256              
257             =item * B<eng_name.min> => I<str>
258              
259             Only return records where the 'eng_name' field is greater than or equal to specified value.
260              
261             =item * B<eng_name.not_contains> => I<str>
262              
263             Only return records where the 'eng_name' field does not contain specified text.
264              
265             =item * B<eng_name.not_in> => I<array[str]>
266              
267             Only return records where the 'eng_name' field is not in the specified values.
268              
269             =item * B<eng_name.xmax> => I<str>
270              
271             Only return records where the 'eng_name' field is less than specified value.
272              
273             =item * B<eng_name.xmin> => I<str>
274              
275             Only return records where the 'eng_name' field is greater than specified value.
276              
277             =item * B<fields> => I<array[str]>
278              
279             Select fields to return.
280              
281             =item * B<ind_capital_name> => I<str>
282              
283             Only return records where the 'ind_capital_name' field equals specified value.
284              
285             =item * B<ind_capital_name.contains> => I<str>
286              
287             Only return records where the 'ind_capital_name' field contains specified text.
288              
289             =item * B<ind_capital_name.in> => I<array[str]>
290              
291             Only return records where the 'ind_capital_name' field is in the specified values.
292              
293             =item * B<ind_capital_name.is> => I<str>
294              
295             Only return records where the 'ind_capital_name' field equals specified value.
296              
297             =item * B<ind_capital_name.isnt> => I<str>
298              
299             Only return records where the 'ind_capital_name' field does not equal specified value.
300              
301             =item * B<ind_capital_name.max> => I<str>
302              
303             Only return records where the 'ind_capital_name' field is less than or equal to specified value.
304              
305             =item * B<ind_capital_name.min> => I<str>
306              
307             Only return records where the 'ind_capital_name' field is greater than or equal to specified value.
308              
309             =item * B<ind_capital_name.not_contains> => I<str>
310              
311             Only return records where the 'ind_capital_name' field does not contain specified text.
312              
313             =item * B<ind_capital_name.not_in> => I<array[str]>
314              
315             Only return records where the 'ind_capital_name' field is not in the specified values.
316              
317             =item * B<ind_capital_name.xmax> => I<str>
318              
319             Only return records where the 'ind_capital_name' field is less than specified value.
320              
321             =item * B<ind_capital_name.xmin> => I<str>
322              
323             Only return records where the 'ind_capital_name' field is greater than specified value.
324              
325             =item * B<ind_island_name> => I<str>
326              
327             Only return records where the 'ind_island_name' field equals specified value.
328              
329             =item * B<ind_island_name.contains> => I<str>
330              
331             Only return records where the 'ind_island_name' field contains specified text.
332              
333             =item * B<ind_island_name.in> => I<array[str]>
334              
335             Only return records where the 'ind_island_name' field is in the specified values.
336              
337             =item * B<ind_island_name.is> => I<str>
338              
339             Only return records where the 'ind_island_name' field equals specified value.
340              
341             =item * B<ind_island_name.isnt> => I<str>
342              
343             Only return records where the 'ind_island_name' field does not equal specified value.
344              
345             =item * B<ind_island_name.max> => I<str>
346              
347             Only return records where the 'ind_island_name' field is less than or equal to specified value.
348              
349             =item * B<ind_island_name.min> => I<str>
350              
351             Only return records where the 'ind_island_name' field is greater than or equal to specified value.
352              
353             =item * B<ind_island_name.not_contains> => I<str>
354              
355             Only return records where the 'ind_island_name' field does not contain specified text.
356              
357             =item * B<ind_island_name.not_in> => I<array[str]>
358              
359             Only return records where the 'ind_island_name' field is not in the specified values.
360              
361             =item * B<ind_island_name.xmax> => I<str>
362              
363             Only return records where the 'ind_island_name' field is less than specified value.
364              
365             =item * B<ind_island_name.xmin> => I<str>
366              
367             Only return records where the 'ind_island_name' field is greater than specified value.
368              
369             =item * B<ind_name> => I<str>
370              
371             Only return records where the 'ind_name' field equals specified value.
372              
373             =item * B<ind_name.contains> => I<str>
374              
375             Only return records where the 'ind_name' field contains specified text.
376              
377             =item * B<ind_name.in> => I<array[str]>
378              
379             Only return records where the 'ind_name' field is in the specified values.
380              
381             =item * B<ind_name.is> => I<str>
382              
383             Only return records where the 'ind_name' field equals specified value.
384              
385             =item * B<ind_name.isnt> => I<str>
386              
387             Only return records where the 'ind_name' field does not equal specified value.
388              
389             =item * B<ind_name.max> => I<str>
390              
391             Only return records where the 'ind_name' field is less than or equal to specified value.
392              
393             =item * B<ind_name.min> => I<str>
394              
395             Only return records where the 'ind_name' field is greater than or equal to specified value.
396              
397             =item * B<ind_name.not_contains> => I<str>
398              
399             Only return records where the 'ind_name' field does not contain specified text.
400              
401             =item * B<ind_name.not_in> => I<array[str]>
402              
403             Only return records where the 'ind_name' field is not in the specified values.
404              
405             =item * B<ind_name.xmax> => I<str>
406              
407             Only return records where the 'ind_name' field is less than specified value.
408              
409             =item * B<ind_name.xmin> => I<str>
410              
411             Only return records where the 'ind_name' field is greater than specified value.
412              
413             =item * B<iso3166_2_code> => I<str>
414              
415             Only return records where the 'iso3166_2_code' field equals specified value.
416              
417             =item * B<iso3166_2_code.contains> => I<str>
418              
419             Only return records where the 'iso3166_2_code' field contains specified text.
420              
421             =item * B<iso3166_2_code.in> => I<array[str]>
422              
423             Only return records where the 'iso3166_2_code' field is in the specified values.
424              
425             =item * B<iso3166_2_code.is> => I<str>
426              
427             Only return records where the 'iso3166_2_code' field equals specified value.
428              
429             =item * B<iso3166_2_code.isnt> => I<str>
430              
431             Only return records where the 'iso3166_2_code' field does not equal specified value.
432              
433             =item * B<iso3166_2_code.max> => I<str>
434              
435             Only return records where the 'iso3166_2_code' field is less than or equal to specified value.
436              
437             =item * B<iso3166_2_code.min> => I<str>
438              
439             Only return records where the 'iso3166_2_code' field is greater than or equal to specified value.
440              
441             =item * B<iso3166_2_code.not_contains> => I<str>
442              
443             Only return records where the 'iso3166_2_code' field does not contain specified text.
444              
445             =item * B<iso3166_2_code.not_in> => I<array[str]>
446              
447             Only return records where the 'iso3166_2_code' field is not in the specified values.
448              
449             =item * B<iso3166_2_code.xmax> => I<str>
450              
451             Only return records where the 'iso3166_2_code' field is less than specified value.
452              
453             =item * B<iso3166_2_code.xmin> => I<str>
454              
455             Only return records where the 'iso3166_2_code' field is greater than specified value.
456              
457             =item * B<query> => I<str>
458              
459             Search.
460              
461             =item * B<random> => I<bool> (default: 0)
462              
463             Return records in random order.
464              
465             =item * B<result_limit> => I<int>
466              
467             Only return a certain number of records.
468              
469             =item * B<result_start> => I<int> (default: 1)
470              
471             Only return starting from the n'th record.
472              
473             =item * B<sort> => I<array[str]>
474              
475             Order records according to certain field(s).
476              
477             A list of field names separated by comma. Each field can be prefixed with '-' to
478             specify descending order instead of the default ascending.
479              
480             =item * B<tags> => I<str>
481              
482             Only return records where the 'tags' field equals specified value.
483              
484             =item * B<tags.contains> => I<str>
485              
486             Only return records where the 'tags' field contains specified text.
487              
488             =item * B<tags.in> => I<array[str]>
489              
490             Only return records where the 'tags' field is in the specified values.
491              
492             =item * B<tags.is> => I<str>
493              
494             Only return records where the 'tags' field equals specified value.
495              
496             =item * B<tags.isnt> => I<str>
497              
498             Only return records where the 'tags' field does not equal specified value.
499              
500             =item * B<tags.max> => I<str>
501              
502             Only return records where the 'tags' field is less than or equal to specified value.
503              
504             =item * B<tags.min> => I<str>
505              
506             Only return records where the 'tags' field is greater than or equal to specified value.
507              
508             =item * B<tags.not_contains> => I<str>
509              
510             Only return records where the 'tags' field does not contain specified text.
511              
512             =item * B<tags.not_in> => I<array[str]>
513              
514             Only return records where the 'tags' field is not in the specified values.
515              
516             =item * B<tags.xmax> => I<str>
517              
518             Only return records where the 'tags' field is less than specified value.
519              
520             =item * B<tags.xmin> => I<str>
521              
522             Only return records where the 'tags' field is greater than specified value.
523              
524             =item * B<with_field_names> => I<bool>
525              
526             Return field names in each record (as hash/associative array).
527              
528             When enabled, function will return each record as hash/associative array
529             (field name => value pairs). Otherwise, function will return each record
530             as list/array (field value, field value, ...).
531              
532             =back
533              
534             Returns an enveloped result (an array).
535              
536             First element (status) is an integer containing HTTP status code
537             (200 means OK, 4xx caller error, 5xx function error). Second element
538             (msg) is a string containing error message, or 'OK' if status is
539             200. Third element (result) is optional, the actual result. Fourth
540             element (meta) is called result metadata and is optional, a hash
541             that contains extra information.
542              
543             Return value: (any)
544              
545             =head1 HOMEPAGE
546              
547             Please visit the project's homepage at L<https://metacpan.org/release/Locale-ID-Province>.
548              
549             =head1 SOURCE
550              
551             Source repository is at L<https://github.com/perlancar/perl-Locale-ID-Province>.
552              
553             =head1 BUGS
554              
555             Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Locale-ID-Province>
556              
557             When submitting a bug or request, please include a test-file or a
558             patch to an existing test-file that illustrates the bug or desired
559             feature.
560              
561             =head1 SEE ALSO
562              
563             L<list-id-provinces>
564              
565             Gudang Data Interim project, https://github.com/sharyanto/gudang-data-interim/
566              
567             This API will also be available on GudangAPI, http://gudangapi.com/
568              
569             =head1 AUTHOR
570              
571             perlancar <perlancar@cpan.org>
572              
573             =head1 COPYRIGHT AND LICENSE
574              
575             This software is copyright (c) 2017, 2015, 2014, 2012 by perlancar@cpan.org.
576              
577             This is free software; you can redistribute it and/or modify it under
578             the same terms as the Perl 5 programming language system itself.
579              
580             =cut