Class: TurboTests::FakeException

Inherits:
Struct
  • Object
show all
Defined in:
lib/turbo_tests.rb,
lib/turbo_tests.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#backtraceObject

Returns the value of attribute backtrace

Returns:

  • (Object)

    the current value of backtrace



21
22
23
# File 'lib/turbo_tests.rb', line 21

def backtrace
  @backtrace
end

#causeObject

Returns the value of attribute cause

Returns:

  • (Object)

    the current value of cause



21
22
23
# File 'lib/turbo_tests.rb', line 21

def cause
  @cause
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



21
22
23
# File 'lib/turbo_tests.rb', line 21

def message
  @message
end

Class Method Details

.from_obj(obj) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/turbo_tests.rb', line 23

def self.from_obj(obj)
  if obj
    obj = obj.symbolize_keys

    klass = Class.new(FakeException) { define_singleton_method(:name) { obj[:class_name] } }

    klass.new(obj[:backtrace], obj[:message], FakeException.from_obj(obj[:cause]))
  end
end