class Expedition::Status
Constants
- OK_SEVERITIES
- SEVERITIES
Attributes
code[R]
description[R]
executed_at[R]
message[R]
severity[R]
Public Class Methods
new(body)
click to toggle source
# File lib/expedition/status.rb, line 24 def initialize(body) status = body ? body.first : {} @severity = SEVERITIES[status['STATUS']] @code = status['Code'] @message = status['Msg'] @description = status['Description'] @executed_at = Time.at(status['When']) rescue nil end
Public Instance Methods
error?()
click to toggle source
# File lib/expedition/status.rb, line 46 def error? severity == :error end
fatal?()
click to toggle source
# File lib/expedition/status.rb, line 50 def fatal? severity == :fatal end
info?()
click to toggle source
# File lib/expedition/status.rb, line 38 def info? severity == :info end
ok?()
click to toggle source
# File lib/expedition/status.rb, line 54 def ok? OK_SEVERITIES.include?(severity) end
success?()
click to toggle source
# File lib/expedition/status.rb, line 34 def success? severity == :success end
warn?()
click to toggle source
# File lib/expedition/status.rb, line 42 def warn? severity == :warn end