Module: StockFighter::ApiMixin::GameMasterApi

Included in:
StockFighter::ApiMixin
Defined in:
lib/stock_fighter/api_mixin/game_master_api.rb

Instance Method Summary collapse

Instance Method Details

#list_levelsObject

Raises:

  • (NotImplementedError)


6
7
8
9
10
# File 'lib/stock_fighter/api_mixin/game_master_api.rb', line 6

def list_levels
  raise NotImplementedError

  game_master_http.get '/levels'
end

#restart_instance(instance) ⇒ Object



16
17
18
# File 'lib/stock_fighter/api_mixin/game_master_api.rb', line 16

def restart_instance instance
  game_master_http.post "/instances/#{instance}/restart"
end

#resume_instance(instance) ⇒ Object



24
25
26
# File 'lib/stock_fighter/api_mixin/game_master_api.rb', line 24

def resume_instance instance
  game_master_http.post "/instances/#{instance}/resume"
end

#show_instance(instance) ⇒ Object



28
29
30
# File 'lib/stock_fighter/api_mixin/game_master_api.rb', line 28

def show_instance instance
  game_master_http.get "/instances/#{instance}"
end

#start_current_levelObject



12
13
14
# File 'lib/stock_fighter/api_mixin/game_master_api.rb', line 12

def start_current_level
  game_master_http.post '/levels/first_steps'
end

#stop_instance(instance) ⇒ Object



20
21
22
# File 'lib/stock_fighter/api_mixin/game_master_api.rb', line 20

def stop_instance instance
  game_master_http.post "/instances/#{instance}/stop"
end