Class: Game

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

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

#generationObject



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

def generation
	@game['generation']
end

#nameObject



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

def name
	@game['name']
end

#release_yearObject



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

def release_year
	@game['release_year']
end