The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

OpenGbg::Service::StyrOchStall - Data on rent-a-bike stations

SYNOPSIS

    my $service = OpenGbg->new->styr_och_stall;
    my $response = $service->get_bike_stations;

    print $response->stations->get_by_index(0)->to_text;

DESCRIPTION

Styr och ställ is Gothenburg's bike share program. This service has a couple of methods to get data about the bike stations.

Official documentation

See OpenGbg for general information.

METHODS

get_bike_station($id)

$id is the station id for the station you want to get information about. You'll need to first have fetched the stations with get_bike_stations to get the ids.

Returns a GetBikeStation object.

get_bike_stations(%geography)

%geography is an optional hash used to limit returned stations to a geographical area. Its keys are lat and long, and optionally radius (in metres).

If %geography is absent no geographic filtering is done.

Returns a GetBikeStations object.

EXCEPTIONS

If the http call to the web service fails, a BadResponseFromService exception is thrown. Use Try::Tiny to catch.

AUTHOR

Erik Carlsson <info@code301.com>

COPYRIGHT

Copyright 2014 - Erik Carlsson

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.