Class: Game
Instance Method Summary
collapse
Methods inherited from PokeApi
get, get_resource, type_chart
Constructor Details
#initialize(id) ⇒ Game
Returns a new instance of Game.
5
6
7
|
# File 'lib/pokeruby/game.rb', line 5
def initialize id
@game = self.class.get "#{id}"
end
|
Instance Method Details
#generation ⇒ Object
13
14
15
|
# File 'lib/pokeruby/game.rb', line 13
def generation
@game['generation']
end
|
#name ⇒ Object
9
10
11
|
# File 'lib/pokeruby/game.rb', line 9
def name
@game['name']
end
|
#release_year ⇒ Object
17
18
19
|
# File 'lib/pokeruby/game.rb', line 17
def release_year
@game['release_year']
end
|