Class: PokeApi::Pokemon::PokemonType
- Inherits:
-
Object
- Object
- PokeApi::Pokemon::PokemonType
- Defined in:
- lib/poke_api/pokemon/pokemon_type.rb
Overview
PokemonType object handling all data fetched from /pokemon types
Instance Attribute Summary collapse
-
#slot ⇒ Object
readonly
Returns the value of attribute slot.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data) ⇒ PokemonType
constructor
A new instance of PokemonType.
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
#slot ⇒ Object (readonly)
Returns the value of attribute slot.
5 6 7 |
# File 'lib/poke_api/pokemon/pokemon_type.rb', line 5 def slot @slot end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/poke_api/pokemon/pokemon_type.rb', line 5 def type @type end |