module PokeAPI::Contests

Overview

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

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

Defined in:

pokeapi/contests.cr

Instance Method Summary

Instance Method Detail

def contest_effect(id : UInt32) : PokeAPI::Types::ContestEffect #

Returns a PokeAPI::Types::ContestEffect based on the given id.

An ArgumentError is raised if the id is 0


[View source]
def contest_type(identifier : String | UInt32) : PokeAPI::Types::ContestType #

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

Valid contest types (2021-05-07):

+----+--------+
| id |  name  |
+----+--------+
|  1 | cool   |
|  2 | beauty |
|  3 | cute   |
|  4 | smart  |
|  5 | tough  |
+----+--------+

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


[View source]
def super_contest_effect(id : UInt32) : PokeAPI::Types::SuperContestEffect #

Returns a PokeAPI::Types::SuperContestEffect based on the given id.

An ArgumentError is raised if the id is 0


[View source]