Class: Ra11y::Result
- Inherits:
-
Object
- Object
- Ra11y::Result
- Defined in:
- lib/ra11y/result.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#message ⇒ Object
(also: #to_s)
Returns the value of attribute message.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(hash) ⇒ Result
constructor
A new instance of Result.
- #inspect ⇒ Object
- #notice? ⇒ Boolean
- #warning? ⇒ Boolean
Constructor Details
#initialize(hash) ⇒ Result
Returns a new instance of Result.
7 8 9 10 11 |
# File 'lib/ra11y/result.rb', line 7 def initialize(hash) @code = hash["code"] @message = hash["message"] @type = hash["type"] end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
4 5 6 |
# File 'lib/ra11y/result.rb', line 4 def code @code end |
#message ⇒ Object Also known as: to_s
Returns the value of attribute message.
4 5 6 |
# File 'lib/ra11y/result.rb', line 4 def @message end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/ra11y/result.rb', line 4 def type @type end |
Instance Method Details
#error? ⇒ Boolean
13 14 15 |
# File 'lib/ra11y/result.rb', line 13 def error? type == "error" end |
#inspect ⇒ Object
25 26 27 |
# File 'lib/ra11y/result.rb', line 25 def inspect "#<Ra11y::Result code=\"#{code}\" type=\"#{type}\">" end |
#notice? ⇒ Boolean
17 18 19 |
# File 'lib/ra11y/result.rb', line 17 def notice? type == "notice" end |
#warning? ⇒ Boolean
21 22 23 |
# File 'lib/ra11y/result.rb', line 21 def warning? type == "warning" end |