module

PokeAPI::Locations

The PokeAPI::Locations module contains methods to get data from the different endpoints in the Locations group.

NOTE: see https://pokeapi.co/docs/v2#locations-section

Instance methods

location(identifier : String | UInt32) : PokeAPI::Types::Location

Returns a PokeAPI::Types::Location based on the given identifier. The identifier can be either the id or the name of the desired location.

An ArgumentError is raised if the identifier is an empty string or 0

Source
location_area(identifier : String | UInt32) : PokeAPI::Types::LocationArea

Returns a PokeAPI::Types::LocationArea based on the given identifier. The identifier can be either the id or the name of the desired location area.

An ArgumentError is raised if the identifier is an empty string or 0

Source
pal_park_area(identifier : String | UInt32) : PokeAPI::Types::PalParkArea

Returns a PokeAPI::Types::PalParkArea based on the given identifier. The identifier can be either the id or the name of the desired pal park area.

Valid pal park areas (2021-05-08):

+----+----------+
| id |   name   |
+----+----------+
|  1 | forest   |
|  2 | field    |
|  3 | mountain |
|  4 | pond     |
|  5 | sea      |
+----+----------+

An ArgumentError is raised if the identifier is an empty string or 0

Source
region(identifier : String | UInt32) : PokeAPI::Types::Region

Returns a PokeAPI::Types::Region based on the given identifier. The identifier can be either the id or the name of the desired region.

Valid regions (2021-05-08):

+----+------------+
| id |    name    |
+----+------------+
|  1 | kanto      |
|  2 | johto      |
|  3 | hoenn      |
|  4 | sinnoh     |
|  5 | unova      |
|  6 | kalos      |
|  7 | alola      |
|  8 | galar      |
+----+------------+

An ArgumentError is raised if the identifier is an empty string or 0

Source