module PokeAPI::Games

Overview

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

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

Defined in:

pokeapi/games.cr

Instance Method Summary

Instance Method Detail

def generation(identifier : String | UInt32) : PokeAPI::Types::Generation #

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

Valid generations (2021-05-08):

+----+-----------------+
| id |      name       |
+----+-----------------+
|  1 | generation-i    |
|  2 | generation-ii   |
|  3 | generation-iii  |
|  4 | generation-iv   |
|  5 | generation-v    |
|  6 | generation-vi   |
|  7 | generation-vii  |
|  8 | generation-viii |
+----+-----------------+

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


[View source]
def pokedex(identifier : String | UInt32) : PokeAPI::Types::Pokedex #

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

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


[View source]
def version(identifier : String | UInt32) : PokeAPI::Types::Version #

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

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


[View source]
def version_group(identifier : String | UInt32) : PokeAPI::Types::VersionGroup #

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

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


[View source]