Class: Sprite

Inherits:
PokeApi show all
Defined in:
lib/pokeruby/sprite.rb

Instance Method Summary collapse

Methods inherited from PokeApi

get, get_resource, type_chart

Constructor Details

#initialize(id) ⇒ Sprite

Returns a new instance of Sprite.



5
6
7
# File 'lib/pokeruby/sprite.rb', line 5

def initialize id
	@sprite = self.class.get "#{id}"
end

Instance Method Details

#imageObject



17
18
19
# File 'lib/pokeruby/sprite.rb', line 17

def image
	@sprite['image']
end

#nameObject



9
10
11
# File 'lib/pokeruby/sprite.rb', line 9

def name
	@sprite['name']
end

#pokemonObject



13
14
15
# File 'lib/pokeruby/sprite.rb', line 13

def pokemon
	@sprite['pokemon']
end