Class: Updawg::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/updawg/results.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, status = :pass, message = nil) ⇒ Result

Returns a new instance of Result.



79
80
81
82
83
# File 'lib/updawg/results.rb', line 79

def initialize(name, status = :pass, message = nil)
  @name = name
  @status = status
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



77
78
79
# File 'lib/updawg/results.rb', line 77

def message
  @message
end

#nameObject (readonly)

Returns the value of attribute name.



77
78
79
# File 'lib/updawg/results.rb', line 77

def name
  @name
end

#statusObject (readonly)

Returns the value of attribute status.



77
78
79
# File 'lib/updawg/results.rb', line 77

def status
  @status
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


93
94
95
# File 'lib/updawg/results.rb', line 93

def error?
  :error == @status
end

#status_textObject



97
98
99
100
101
# File 'lib/updawg/results.rb', line 97

def status_text
  return Updawg.configuration.error_text if error?
  return Updawg.configuration.warning_text if warning?
  Updawg.configuration.success_text
end

#success?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/updawg/results.rb', line 85

def success?
  :pass == @status
end

#warning?Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/updawg/results.rb', line 89

def warning?
  :warning == @status
end