Class: HelloGoodbye::ForemanConsole

Inherits:
Console
  • Object
show all
Defined in:
lib/hello_goodbye/consoles/foreman_console.rb

Instance Attribute Summary

Attributes inherited from Console

#foreman

Instance Method Summary collapse

Methods inherited from Console

get, #receive_data, #send_response

Instance Method Details

#receive_command(command) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/hello_goodbye/consoles/foreman_console.rb', line 3

def receive_command(command)
  case command
  when "start"
    self.foreman.employ
    send_response :success => true,
      :message => "ok"
    return true
  when "stop"
    self.foreman.unemploy
    send_response :success => true,
      :message => "ok"
    return true
  when "status"
    send_response :success => true,
      :message => self.foreman.status.to_s
    return true
  end
  super
end