module PokeAPI::Encounters

Overview

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

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

Defined in:

pokeapi/encounters.cr

Instance Method Summary

Instance Method Detail

def encounter_condition(identifier : String | UInt32) : PokeAPI::Types::EncounterCondition #

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

Valid encounter conditions (2021-05-07):

+----+----------------+
| id |      name      |
+----+----------------+
|  1 | swarm          |
|  2 | time           |
|  3 | radar          |
|  4 | slot2          |
|  5 | radio          |
|  6 | season         |
|  7 | starter        |
|  8 | tv-option      |
|  9 | story-progress |
| 10 | other          |
+----+----------------+

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


[View source]
def encounter_condition_value(identifier : String | UInt32) : PokeAPI::Types::EncounterConditionValue #

Returns a PokeAPI::Types::EncounterConditionValue based on the given identifier. The identifier can be either the id or the name of the desired encounter condition value.

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


[View source]
def encounter_method(identifier : String | UInt32) : PokeAPI::Types::EncounterMethod #

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

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


[View source]