Class: Pwnix::Api::Client::Mode
- Inherits:
-
Object
- Object
- Pwnix::Api::Client::Mode
show all
- Includes:
- HTTParty, HTTPartyTime
- Defined in:
- lib/pwnix-api-client/mode.rb
Instance Method Summary
collapse
#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
32
33
34
|
# File 'lib/pwnix-api-client/mode.rb', line 32
def available?
safe_api_call("/mode/#{@mode_name}/available")
end
|
#running? ⇒ Boolean
28
29
30
|
# File 'lib/pwnix-api-client/mode.rb', line 28
def running?
safe_api_call("/mode/#{@mode_name}/running")
end
|
#start ⇒ Object
12
13
14
|
# File 'lib/pwnix-api-client/mode.rb', line 12
def start
safe_api_call("/mode/#{@mode_name}/start")
end
|
#status ⇒ Object
20
21
22
|
# File 'lib/pwnix-api-client/mode.rb', line 20
def status
safe_api_call("/mode/#{@mode_name}/status")
end
|
#status_string ⇒ Object
24
25
26
|
# File 'lib/pwnix-api-client/mode.rb', line 24
def status_string
safe_api_call("/mode/#{@mode_name}/status_string")
end
|
#stop ⇒ Object
16
17
18
|
# File 'lib/pwnix-api-client/mode.rb', line 16
def stop
safe_api_call("/mode/#{@mode_name}/stop")
end
|