Class: Substation::Response::Exception::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/substation/response/exception/output.rb

Overview

Wraps response data and an exception not caught from a handler

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, exception) ⇒ undefined

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.

Initialize a new instance

Parameters:

  • data (Object)

    the data available when exception was raised

  • exception (Class<StandardError>)

    the exception instance raised from a handler



36
37
38
# File 'lib/substation/response/exception/output.rb', line 36

def initialize(data, exception)
  @data, @exception = data, exception
end

Instance Attribute Details

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

Return the data available when exception was raised

Returns:

  • (Object)


16
17
18
# File 'lib/substation/response/exception/output.rb', line 16

def data
  @data
end

#exceptionClass<StandardError> (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.

Return the exception instance

Returns:

  • (Class<StandardError>)


23
24
25
# File 'lib/substation/response/exception/output.rb', line 23

def exception
  @exception
end