Class: PokeApi::Pokemon::PokemonAbility
- Inherits:
-
Object
- Object
- PokeApi::Pokemon::PokemonAbility
- Defined in:
- lib/poke_api/pokemon/pokemon_ability.rb
Overview
PokemonAbility object handling all data fetched from /pokemon abilities
Instance Attribute Summary collapse
-
#ability ⇒ Object
readonly
Returns the value of attribute ability.
-
#is_hidden ⇒ Object
readonly
Returns the value of attribute is_hidden.
-
#slot ⇒ Object
readonly
Returns the value of attribute slot.
Instance Method Summary collapse
-
#initialize(data) ⇒ PokemonAbility
constructor
A new instance of PokemonAbility.
Constructor Details
#initialize(data) ⇒ PokemonAbility
Returns a new instance of PokemonAbility.
9 10 11 12 13 |
# File 'lib/poke_api/pokemon/pokemon_ability.rb', line 9 def initialize(data) @is_hidden = data[:is_hidden] @slot = data[:slot] @ability = Ability.new(data[:ability]) end |
Instance Attribute Details
#ability ⇒ Object (readonly)
Returns the value of attribute ability.
5 6 7 |
# File 'lib/poke_api/pokemon/pokemon_ability.rb', line 5 def ability @ability end |
#is_hidden ⇒ Object (readonly)
Returns the value of attribute is_hidden.
5 6 7 |
# File 'lib/poke_api/pokemon/pokemon_ability.rb', line 5 def is_hidden @is_hidden end |
#slot ⇒ Object (readonly)
Returns the value of attribute slot.
5 6 7 |
# File 'lib/poke_api/pokemon/pokemon_ability.rb', line 5 def slot @slot end |