Class: Stoplight::Domain::Failure Private
- Inherits:
-
Object
- Object
- Stoplight::Domain::Failure
- Defined in:
- lib/stoplight/domain/failure.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #error_class ⇒ String readonly private
- #error_message ⇒ String readonly private
- #time ⇒ Time (also: #occurred_at) readonly private
Class Method Summary collapse
-
.from_error(error, time:) ⇒ Failure
private
A new instance of Failure.
Instance Method Summary collapse
- #==(other) ⇒ Boolean private
-
#initialize(error_class, error_message, time) ⇒ Failure
constructor
private
A new instance of Failure.
Constructor Details
#initialize(error_class, error_message, time) ⇒ Failure
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Failure.
29 30 31 32 33 |
# File 'lib/stoplight/domain/failure.rb', line 29 def initialize(error_class, , time) @error_class = error_class @error_message = @time = time end |
Instance Attribute Details
#error_class ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/stoplight/domain/failure.rb', line 12 def error_class @error_class end |
#error_message ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/stoplight/domain/failure.rb', line 15 def @error_message end |
#time ⇒ Time (readonly) Also known as: occurred_at
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'lib/stoplight/domain/failure.rb', line 18 def time @time end |
Class Method Details
.from_error(error, time:) ⇒ Failure
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Failure.
22 23 24 |
# File 'lib/stoplight/domain/failure.rb', line 22 def self.from_error(error, time:) new(error.class.name, error., time) end |
Instance Method Details
#==(other) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 42 43 44 |
# File 'lib/stoplight/domain/failure.rb', line 39 def ==(other) other.is_a?(self.class) && error_class == other.error_class && == other. && time == other.time end |