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