Class: PokeApi::Pokedex::PokemonEntry
- Inherits:
-
Object
- Object
- PokeApi::Pokedex::PokemonEntry
- Defined in:
- lib/poke_api/pokedex/pokemon_entry.rb
Overview
Pokdex object handling all data fetched from /pokedex
Instance Attribute Summary collapse
-
#entry_number ⇒ Object
readonly
Returns the value of attribute entry_number.
-
#pokemon_species ⇒ Object
readonly
Returns the value of attribute pokemon_species.
Instance Method Summary collapse
-
#initialize(data) ⇒ PokemonEntry
constructor
A new instance of PokemonEntry.
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_number ⇒ Object (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_species ⇒ Object (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 |