Class: Updawg::Result
- Inherits:
-
Object
- Object
- Updawg::Result
- Defined in:
- lib/updawg/results.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(name, status = :pass, message = nil) ⇒ Result
constructor
A new instance of Result.
- #status_text ⇒ Object
- #success? ⇒ Boolean
- #warning? ⇒ Boolean
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, = nil) @name = name @status = status @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
77 78 79 |
# File 'lib/updawg/results.rb', line 77 def @message end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
77 78 79 |
# File 'lib/updawg/results.rb', line 77 def name @name end |
#status ⇒ Object (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
93 94 95 |
# File 'lib/updawg/results.rb', line 93 def error? :error == @status end |
#status_text ⇒ Object
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
85 86 87 |
# File 'lib/updawg/results.rb', line 85 def success? :pass == @status end |
#warning? ⇒ Boolean
89 90 91 |
# File 'lib/updawg/results.rb', line 89 def warning? :warning == @status end |