Class: Jsapi::Controller::ErrorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/jsapi/controller/error_result.rb

Overview

Used by api_operation! to produce an error response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception, status:) ⇒ ErrorResult

Creates a new instance to produce an error response with the given HTTP status code.



15
16
17
18
# File 'lib/jsapi/controller/error_result.rb', line 15

def initialize(exception, status:)
  @exception = exception
  @status = status
end

Instance Attribute Details

#statusObject (readonly)

The HTTP status code of the error response to be produced.



9
10
11
# File 'lib/jsapi/controller/error_result.rb', line 9

def status
  @status
end