Class: Steto::BaseCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/steto/base_check.rb

Direct Known Subclasses

NagiosCheck, ProcCheck

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/steto/base_check.rb', line 3

def name
  @name
end

#textObject

Returns the value of attribute text.



22
23
24
# File 'lib/steto/base_check.rb', line 22

def text
  @text
end

Instance Method Details

#attributes=(attributes = {}) ⇒ Object



5
6
7
# File 'lib/steto/base_check.rb', line 5

def attributes=(attributes = {})
  attributes.each { |k,v| send "#{k}=", v }
end

#check_if_neededObject



9
10
11
# File 'lib/steto/base_check.rb', line 9

def check_if_needed
  check unless @status
end

#statusObject



13
14
15
16
# File 'lib/steto/base_check.rb', line 13

def status
  check_if_needed
  @status
end

#status=(status) ⇒ Object



18
19
20
# File 'lib/steto/base_check.rb', line 18

def status=(status)
  @status = Status.new status
end

#to_json(*args) ⇒ Object



28
29
30
# File 'lib/steto/base_check.rb', line 28

def to_json(*args)
  { :name => name, :status => status, :text => text }.to_json(*args)
end