Class: Gamesdb::Client::Mock
- Inherits:
-
Object
- Object
- Gamesdb::Client::Mock
- 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
- #data ⇒ Object
- #get_game(id) ⇒ Object
- #get_platform ⇒ Object
- #get_platform_games(id) ⇒ Object
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
- #list_games ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
63 64 |
# File 'lib/gamesdb/client.rb', line 63 def initialize(={}) end |
Class Method Details
.data ⇒ Object
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
#data ⇒ Object
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.("../../seeds/games.yaml", __FILE__)) end |
#get_platform ⇒ Object
12 13 14 |
# File 'lib/gamesdb/requests/get_platform.rb', line 12 def get_platform YAML.load_file(File.("../../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.("../../seeds/games.yaml", __FILE__))["Game"] end |
#list_games ⇒ Object
12 13 14 |
# File 'lib/gamesdb/requests/list_games.rb', line 12 def list_games(search) YAML.load_file(File.("../../seeds/games.yaml", __FILE__)) end |