Class: Smooth::ErrorResponse

Inherits:
Response show all
Defined in:
lib/smooth/response.rb

Instance Attribute Summary

Attributes inherited from Response

#command_action, #current_user, #event_namespace, #object, #outcome, #request_headers, #serializer, #serializer_klass, #serializer_options, #success

Instance Method Summary collapse

Methods inherited from Response

#headers, #options, #status, #to_rack

Constructor Details

#initialize(error_message, _request_object, *_args) ⇒ ErrorResponse

Returns a new instance of ErrorResponse.



59
60
61
# File 'lib/smooth/response.rb', line 59

def initialize(error_message, _request_object, *_args)
  @error_message = error_message
end

Instance Method Details

#bodyObject



67
68
69
70
71
# File 'lib/smooth/response.rb', line 67

def body
  {
    error: error_message
  }
end

#success?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/smooth/response.rb', line 63

def success?
  false
end