class StatusPageRuby::Status
Constants
- DOWN_STATE
- HISTORY_RECORD_TIME_FORMAT
- UP_STATE
Attributes
service[R]
state[R]
status[R]
time[R]
Public Class Methods
new(service, state, status, time)
click to toggle source
# File lib/status_page_ruby/status.rb, line 9 def initialize(service, state, status, time) @service = service.to_s @state = state.to_s @status = status.to_s @time = time.to_s end
Public Instance Methods
down?()
click to toggle source
# File lib/status_page_ruby/status.rb, line 20 def down? state == DOWN_STATE end
history_record()
click to toggle source
# File lib/status_page_ruby/status.rb, line 24 def history_record [service, state, Time.at(time.to_i).utc.strftime(HISTORY_RECORD_TIME_FORMAT)] end
record()
click to toggle source
# File lib/status_page_ruby/status.rb, line 28 def record [service, state, status, time] end
to_csv()
click to toggle source
# File lib/status_page_ruby/status.rb, line 32 def to_csv record.to_csv end
up?()
click to toggle source
# File lib/status_page_ruby/status.rb, line 16 def up? state == UP_STATE end