Class: Gamesdb::Client::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/gamesdb/client.rb,
lib/gamesdb/requests/get_game.rb,
lib/gamesdb/requests/list_games.rb,
lib/gamesdb/requests/get_platform.rb,
lib/gamesdb/requests/list_platforms.rb,
lib/gamesdb/requests/get_platform_games.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



63
64
# File 'lib/gamesdb/client.rb', line 63

def initialize(options={})
end

Class Method Details

.dataObject



66
67
68
# File 'lib/gamesdb/client.rb', line 66

def self.data
  @data ||= {}
end

.reset!Object



70
71
72
# File 'lib/gamesdb/client.rb', line 70

def self.reset!
  @data = nil
end

Instance Method Details

#dataObject



74
75
76
# File 'lib/gamesdb/client.rb', line 74

def data
  self.class.data
end

#get_game(id) ⇒ Object



12
13
14
# File 'lib/gamesdb/requests/get_game.rb', line 12

def get_game(id)
  YAML.load_file(File.expand_path("../../seeds/games.yaml", __FILE__))
end

#get_platformObject



12
13
14
# File 'lib/gamesdb/requests/get_platform.rb', line 12

def get_platform
  YAML.load_file(File.expand_path("../../seeds/platforms.yaml", __FILE__))
end

#get_platform_games(id) ⇒ Object



12
13
14
# File 'lib/gamesdb/requests/get_platform_games.rb', line 12

def get_platform_games(id)
  games = YAML.load_file(File.expand_path("../../seeds/games.yaml", __FILE__))["Game"]
end

#list_gamesObject



12
13
14
# File 'lib/gamesdb/requests/list_games.rb', line 12

def list_games(search)
  YAML.load_file(File.expand_path("../../seeds/games.yaml", __FILE__))
end