Class: Evilution::Result::ErrorInfo Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/result/error_info.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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message: nil, klass: nil, backtrace: nil) ⇒ ErrorInfo

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 ErrorInfo.



14
15
16
17
18
19
# File 'lib/evilution/result/error_info.rb', line 14

def initialize(message: nil, klass: nil, backtrace: nil)
  @message = message
  @klass = klass
  @backtrace = backtrace.nil? ? nil : backtrace.dup.freeze
  freeze
end

Instance Attribute Details

#backtraceObject (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.



6
7
8
# File 'lib/evilution/result/error_info.rb', line 6

def backtrace
  @backtrace
end

#klassObject (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.



6
7
8
# File 'lib/evilution/result/error_info.rb', line 6

def klass
  @klass
end

#messageObject (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.



6
7
8
# File 'lib/evilution/result/error_info.rb', line 6

def message
  @message
end

Class Method Details

.from_fields(message: nil, klass: nil, backtrace: nil) ⇒ Object

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.



8
9
10
11
12
# File 'lib/evilution/result/error_info.rb', line 8

def self.from_fields(message: nil, klass: nil, backtrace: nil)
  return nil if message.nil? && klass.nil? && backtrace.nil?

  new(message: message, klass: klass, backtrace: backtrace)
end