Class: Pwnix::Api::Client::Mode

Inherits:
Object
  • Object
show all
Includes:
HTTParty, HTTPartyTime
Defined in:
lib/pwnix-api-client/mode.rb

Instance Method Summary collapse

Methods included from HTTPartyTime

#clear_errors, #errors, #has_errors?, included, #last_error, #safe_api_call

Constructor Details

#initialize(mode_name) ⇒ Mode

Returns a new instance of Mode.



8
9
10
# File 'lib/pwnix-api-client/mode.rb', line 8

def initialize(mode_name)
  @mode_name = mode_name
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/pwnix-api-client/mode.rb', line 32

def available?
  safe_api_call("/mode/#{@mode_name}/available")
end

#running?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/pwnix-api-client/mode.rb', line 28

def running?
  safe_api_call("/mode/#{@mode_name}/running")
end

#startObject



12
13
14
# File 'lib/pwnix-api-client/mode.rb', line 12

def start
  safe_api_call("/mode/#{@mode_name}/start")
end

#statusObject



20
21
22
# File 'lib/pwnix-api-client/mode.rb', line 20

def status
  safe_api_call("/mode/#{@mode_name}/status")
end

#status_stringObject



24
25
26
# File 'lib/pwnix-api-client/mode.rb', line 24

def status_string
  safe_api_call("/mode/#{@mode_name}/status_string")
end

#stopObject



16
17
18
# File 'lib/pwnix-api-client/mode.rb', line 16

def stop
  safe_api_call("/mode/#{@mode_name}/stop")
end