Class: ActiveStatus::Error
- Inherits:
-
Object
- Object
- ActiveStatus::Error
- Defined in:
- lib/active_status/error.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #as_json(_ = nil) ⇒ Object
-
#initialize(name, error, message = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(name, error, message = nil) ⇒ Error
Returns a new instance of Error.
5 6 7 8 9 |
# File 'lib/active_status/error.rb', line 5 def initialize(name, error, = nil) @name = name @error = error @message = end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
3 4 5 |
# File 'lib/active_status/error.rb', line 3 def error @error end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/active_status/error.rb', line 3 def @message end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/active_status/error.rb', line 3 def name @name end |
Instance Method Details
#as_json(_ = nil) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/active_status/error.rb', line 11 def as_json(_ = nil) hash = { name: name, error: error } return hash unless ActiveStatus.config.verbose hash.merge({ message: }) end |