Class: PokeAPI::Pokemon

Inherits:
Base
  • Object
show all
Defined in:
lib/pokeapi/pokemon.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find(id) ⇒ Object



14
15
16
17
# File 'lib/pokeapi/pokemon.rb', line 14

def find(id)
  response = Requester.pokemon(id)
  new response
end

Instance Method Details

#speciesObject



20
21
22
23
24
25
# File 'lib/pokeapi/pokemon.rb', line 20

def species
  @species ||= begin
                 response = Requester.species(species_id)
                 Species.new response
               end
end