Class: Deas::ShowExceptions::Body

Inherits:
Object
  • Object
show all
Defined in:
lib/deas/show_exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(e) ⇒ Body

Returns a new instance of Body.



38
39
40
# File 'lib/deas/show_exceptions.rb', line 38

def initialize(e)
  @content ||= "#{e.class}: #{e.message}\n#{(e.backtrace || []).join("\n")}"
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



37
38
39
# File 'lib/deas/show_exceptions.rb', line 37

def content
  @content
end

Instance Method Details

#mime_typeObject



46
47
48
# File 'lib/deas/show_exceptions.rb', line 46

def mime_type
  @mime_type ||= "text/plain"
end

#sizeObject



42
43
44
# File 'lib/deas/show_exceptions.rb', line 42

def size
  @size ||= Rack::Utils.bytesize(self.content)
end