module PokeAPI::Items

Overview

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

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

Defined in:

pokeapi/items.cr

Instance Method Summary

Instance Method Detail

def item(identifier : String | UInt32) : PokeAPI::Types::Item #

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

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


[View source]
def item_attribute(identifier : String | UInt32) : PokeAPI::Types::ItemAttribute #

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

Valid item attributes (2021-05-08):

+----+------------------+
| id |       name       |
+----+------------------+
|  1 | countable        |
|  2 | consumable       |
|  3 | usable-overworld |
|  4 | usable-in-battle |
|  5 | holdable         |
|  6 | holdable-passive |
|  7 | holdable-active  |
|  8 | underground      |
+----+------------------+

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


[View source]
def item_category(identifier : String | UInt32) : PokeAPI::Types::ItemCategory #

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

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


[View source]
def item_fling_effect(identifier : String | UInt32) : PokeAPI::Types::ItemFlingEffect #

Returns a PokeAPI::Types::ItemFlingEffect based on the given identifier. The identifier can be either the id or the name of the desired item fling effect.

Valid item fling effects (2021-05-08):

+----+--------------+
| id |     name     |
+----+--------------+
|  1 | badly-poison |
|  2 | burn         |
|  3 | berry-effect |
|  4 | herb-effect  |
|  5 | paralyze     |
|  6 | poison       |
|  7 | flinch       |
+----+--------------+

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


[View source]
def item_pocket(identifier : String | UInt32) : PokeAPI::Types::ItemPocket #

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

Valid item pockets (2021-05-08):

+----+-----------+
| id |   name    |
+----+-----------+
|  1 | misc      |
|  2 | medicine  |
|  3 | pokeballs |
|  4 | machines  |
|  5 | berries   |
|  6 | mail      |
|  7 | battle    |
|  8 | key       |
+----+-----------+

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


[View source]