Class: PokeApi::Pokemon::PokemonType

Inherits:
Object
  • Object
show all
Defined in:
lib/poke_api/pokemon/pokemon_type.rb

Overview

PokemonType object handling all data fetched from /pokemon types

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ PokemonType

Returns a new instance of PokemonType.



8
9
10
11
# File 'lib/poke_api/pokemon/pokemon_type.rb', line 8

def initialize(data)
  @slot = data[:slot]
  @type = Type.new(data[:type])
end

Instance Attribute Details

#slotObject (readonly)

Returns the value of attribute slot.



5
6
7
# File 'lib/poke_api/pokemon/pokemon_type.rb', line 5

def slot
  @slot
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/poke_api/pokemon/pokemon_type.rb', line 5

def type
  @type
end