class Pokemon
Public Class Methods
new(id)
click to toggle source
# File lib/pokeruby/pokemon.rb, line 9 def initialize id @pokemon = self.class.get_resource "pokemon/#{id}/" end
Public Instance Methods
abilities()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 25 def abilities @abilities ||= @pokemon['abilities'].collect { |ability| Ability.new ability['resource_uri'] } end
attack()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 57 def attack @pokemon['attack'] end
catch_rate()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 45 def catch_rate @pokemon['catch_rate'] end
defense()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 61 def defense @pokemon['defense'] end
descriptions()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 37 def descriptions @descriptions ||= @pokemon['descriptions'].collect { |description| Description.new description['resource_uri'] } end
egg_cycles()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 81 def egg_cycles @pokemon['egg_cycles'] end
egg_groups()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 29 def egg_groups @egg_groups ||= @pokemon['egg_groups'].collect { |egg_group| EggGroup.new egg_group['resource_uri'] } end
equal?(other)
click to toggle source
# File lib/pokeruby/pokemon.rb, line 113 def equal? other self.name == other.name end
ev_yield()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 85 def ev_yield @pokemon['ev_yield'] end
evolutions()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 33 def evolutions @evolutions ||= @pokemon['evolutions'].collect { |evolution| Pokemon.new evolution['resource_uri'] } end
exp()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 89 def exp @pokemon['exp'] end
growth_rate()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 93 def growth_rate @pokemon['growth_rate'] end
happiness()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 105 def happiness @pokemon['happiness'] end
height()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 97 def height @pokemon['height'] end
hp()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 53 def hp @pokemon['hp'] end
male_female_ratio()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 109 def male_female_ratio @pokemon['male_female_ratio'] end
moves()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 41 def moves @moves ||= @pokemon['moves'].collect { |move| Move.new move['resource_uri'] } end
name()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 17 def name @pokemon['name'] end
national_id()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 13 def national_id @pokemon['national_id'] end
sp_atk()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 65 def sp_atk @pokemon['sp_atk'] end
sp_def()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 69 def sp_def @pokemon['sp_def'] end
species()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 49 def species @pokemon['species'] end
speed()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 73 def speed @pokemon['speed'] end
total()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 77 def total @pokemon['total'] end
types()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 21 def types @types ||= @pokemon['types'].collect { |type| Type.new type['resource_uri'] } end
weight()
click to toggle source
# File lib/pokeruby/pokemon.rb, line 101 def weight @pokemon['weight'] end