Class: ActiveError::ExceptionMock::TemplateError

Inherits:
ActionView::Template::Error
  • Object
show all
Defined in:
lib/active_error/exception_mock/template_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fault:) ⇒ TemplateError

Returns a new instance of TemplateError.



8
9
10
11
12
13
14
15
# File 'lib/active_error/exception_mock/template_error.rb', line 8

def initialize(fault:)
  @klass = fault.klass
  set_backtrace(fault.backtrace)
  @message = fault.message
  @blamed_files = fault.blamed_files
  @template = fault.template
  @cause = ExceptionMock.make(fault: fault.cause)
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



21
22
23
# File 'lib/active_error/exception_mock/template_error.rb', line 21

def message
  @message
end

Instance Method Details

#classObject



17
18
19
# File 'lib/active_error/exception_mock/template_error.rb', line 17

def class
  klass.constantize
end