Skip to content

Commit 13fed9c

Browse files
committed
improved pod
1 parent 86de5ce commit 13fed9c

1 file changed

Lines changed: 48 additions & 15 deletions

File tree

lib/Geo/Address/Formatter.pm

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,23 @@ Returns one instance. The I<conf_path> is required.
7878
7979
Optional parameters are:
8080
81-
I<debug>: prints tons of debugging info for use in development.
81+
=over
8282
83-
I<no_warnings>: turns off a few warnings if configuration is not optimal.
83+
=item * I<debug>
8484
85-
I<only_address>: formatted will only contain known components (will not include POI names). Note, can be overridden with optional param to format_address method.
85+
Prints tons of debugging info for use in development.
86+
87+
=item * I<no_warnings>
88+
89+
Turns off a few warnings if configuration is not optimal.
90+
91+
=item * I<only_address>
92+
93+
Formatted output will only contain known address components (will not
94+
include POI names). Can be overridden per-call via the I<only_address>
95+
option to L</format_address>.
96+
97+
=back
8698
8799
=cut
88100

@@ -363,9 +375,10 @@ sub _precompile_abbreviations {
363375
364376
my $rh_components = $GAF->final_components();
365377
366-
returns a reference to a hash of the final components that are set at the
367-
completion of B<format_address>. Warns if called before they have been set
368-
(unless I<no_warnings> was set at object creation).
378+
Returns a reference to a hash of the final components that were set during
379+
the most recent call to B<format_address>. Returns C<undef> if called
380+
before B<format_address> has been called. Warns in that case unless
381+
I<no_warnings> was set at object creation.
369382
370383
=cut
371384

@@ -383,21 +396,32 @@ sub final_components {
383396
my $text = $GAF->format_address(\%components, \%options );
384397
385398
Given structured address components (hashref) and options (hashref) returns a
386-
formatted address (string).
399+
formatted address as a multiline string with a trailing newline.
387400
388401
Possible options are:
389402
390-
'abbreviate', if supplied common abbreviations are applied
391-
to the resulting output.
403+
=over
404+
405+
=item * I<abbreviate>
406+
407+
If true, common abbreviations are applied to the resulting output.
408+
409+
=item * I<address_template>
392410
393-
'address_template', a mustache format template to be used instead of the template
394-
defined in the configuration
411+
A Mustache-format template to be used instead of the template defined in
412+
the configuration.
395413
396-
'country', which should be an uppercase ISO 3166-1:alpha-2 code
397-
e.g. 'GB' for Great Britain, 'DE' for Germany, etc.
398-
If omitted we try to find the country in the address components.
414+
=item * I<country>
399415
400-
'only_address', same as only_address global option but set at formatting level
416+
An uppercase ISO 3166-1 alpha-2 code, e.g. C<'GB'> for Great Britain,
417+
C<'DE'> for Germany, etc. If omitted the country is determined from
418+
the address components.
419+
420+
=item * I<only_address>
421+
422+
Same as the I<only_address> constructor option but applied per-call.
423+
424+
=back
401425
402426
=cut
403427

@@ -1172,4 +1196,13 @@ sub _find_unknown_components {
11721196
return \@a_unknown;
11731197
}
11741198

1199+
=head1 SEE ALSO
1200+
1201+
L<https://github.com/OpenCageData/address-formatting> - the address
1202+
formatting template configuration used by this module.
1203+
1204+
L<https://opencagedata.com> - OpenCage geocoder.
1205+
1206+
=cut
1207+
11751208
1;

0 commit comments

Comments
 (0)