Exception: Traim::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/traim.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Error

Returns a new instance of Error.



109
110
111
112
113
# File 'lib/traim.rb', line 109

def initialize(options = {})
  @message = options[:message] || error_message 
  @body    = options[:body]    || error_message
  super(@message)
end

Instance Method Details

#bodyObject



118
# File 'lib/traim.rb', line 118

def body; {message: @body} end

#error_messageObject



116
# File 'lib/traim.rb', line 116

def error_message; 'Internal Server Error' end

#headerObject



117
# File 'lib/traim.rb', line 117

def header; DEFAULT_HEADER end

#statusObject



115
# File 'lib/traim.rb', line 115

def status; 500 end