Class: Pwnix::Api::Client::Shell

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

Instance Method Summary collapse

Methods included from HTTPartyTime

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

Constructor Details

#initialize(shell_name) ⇒ Shell

Returns a new instance of Shell.



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

def initialize(shell_name)
  @shell_name = shell_name
end

Instance Method Details

#configure(config = {}) ⇒ Object

Configuration options



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

def configure(config={}) # Configuration options
  safe_api_call("/shells/#{@shell_name}/configure", config )
end

#disableObject



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

def disable
  safe_api_call("/shells/#{@shell_name}/disable")
end

#enableObject



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

def enable
  safe_api_call("/shells/#{@shell_name}/enable")
end

#running?Boolean

Returns:

  • (Boolean)


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

def running?
  safe_api_call("/shells/#{@shell_name}/running")
end

#statusObject



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

def status
  safe_api_call("/shells/#{@shell_name}/status")
end