Class: PokeApi::Pokedex::PokemonEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/poke_api/pokedex/pokemon_entry.rb

Overview

Pokdex object handling all data fetched from /pokedex

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ PokemonEntry

Returns a new instance of PokemonEntry.



8
9
10
11
# File 'lib/poke_api/pokedex/pokemon_entry.rb', line 8

def initialize(data)
  @entry_number = data[:entry_number]
  @pokemon_species = PokemonSpecies.new(data[:pokemon_species])
end

Instance Attribute Details

#entry_numberObject (readonly)

Returns the value of attribute entry_number.



5
6
7
# File 'lib/poke_api/pokedex/pokemon_entry.rb', line 5

def entry_number
  @entry_number
end

#pokemon_speciesObject (readonly)

Returns the value of attribute pokemon_species.



5
6
7
# File 'lib/poke_api/pokedex/pokemon_entry.rb', line 5

def pokemon_species
  @pokemon_species
end