Class: Easymon::SemaphoreCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/easymon/checks/semaphore_check.rb

Direct Known Subclasses

TrafficEnabledCheck

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name) ⇒ SemaphoreCheck

Returns a new instance of SemaphoreCheck.



5
6
7
# File 'lib/easymon/checks/semaphore_check.rb', line 5

def initialize(file_name)
  self.file_name = file_name
end

Instance Attribute Details

#file_nameObject

Returns the value of attribute file_name.



3
4
5
# File 'lib/easymon/checks/semaphore_check.rb', line 3

def file_name
  @file_name
end

Instance Method Details

#checkObject



9
10
11
12
13
14
15
16
17
# File 'lib/easymon/checks/semaphore_check.rb', line 9

def check
  check_status = semaphore_exists?
  if check_status
    message = "#{file_name} is in place!"
  else
    message = "#{file_name} does not exist!"
  end
  [check_status, message]
end