Class: Sprite
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
#image ⇒ Object
17
18
19
|
# File 'lib/pokeruby/sprite.rb', line 17
def image
@sprite['image']
end
|
#name ⇒ Object
9
10
11
|
# File 'lib/pokeruby/sprite.rb', line 9
def name
@sprite['name']
end
|
#pokemon ⇒ Object
13
14
15
|
# File 'lib/pokeruby/sprite.rb', line 13
def pokemon
@sprite['pokemon']
end
|