Class: PokeApi::Ability::AbilityPokemon

Inherits:
Object
  • Object
show all
Defined in:
lib/poke_api/ability/ability_pokemon.rb

Overview

AbilityPokemon object handling all data fetched from /ability pokemon

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ AbilityPokemon

Returns a new instance of AbilityPokemon.



9
10
11
12
13
# File 'lib/poke_api/ability/ability_pokemon.rb', line 9

def initialize(data)
  @is_hidden = data[:is_hidden]
  @slot = data[:slot]
  @pokemon = Pokemon.new(data[:pokemon])
end

Instance Attribute Details

#is_hiddenObject (readonly)

Returns the value of attribute is_hidden.



5
6
7
# File 'lib/poke_api/ability/ability_pokemon.rb', line 5

def is_hidden
  @is_hidden
end

#pokemonObject (readonly)

Returns the value of attribute pokemon.



5
6
7
# File 'lib/poke_api/ability/ability_pokemon.rb', line 5

def pokemon
  @pokemon
end

#slotObject (readonly)

Returns the value of attribute slot.



5
6
7
# File 'lib/poke_api/ability/ability_pokemon.rb', line 5

def slot
  @slot
end