Class: Watchman::CallWatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/watchman/call_watcher.rb

Instance Method Summary collapse

Constructor Details

#initializeCallWatcher

Returns a new instance of CallWatcher.



4
5
6
# File 'lib/watchman/call_watcher.rb', line 4

def initialize
  @client = Client.new
end

Instance Method Details

#current_call_incident_numbersObject



16
17
18
19
# File 'lib/watchman/call_watcher.rb', line 16

def current_call_incident_numbers
  page = @client.get("AjaxDC2.php")
  page.parser.to_s.scan(/DisplayCall\.php\?Incid\=(\d+)/).flatten
end

#info_for(incident_number) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/watchman/call_watcher.rb', line 8

def info_for(incident_number)
  call = Call.new(@client.get("DisplayCall.php?Incid=#{incident_number}"))
  if call.notes.size == 0
    call = Call.new(@client.get("DisplayFireCall.php?Incid=#{incident_number}"))
  end
  call
end