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