Class: Deas::ShowExceptions::Body
- Inherits:
-
Object
- Object
- Deas::ShowExceptions::Body
- Defined in:
- lib/deas/show_exceptions.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
-
#initialize(e) ⇒ Body
constructor
A new instance of Body.
- #mime_type ⇒ Object
- #size ⇒ Object
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.}\n#{(e.backtrace || []).join("\n")}" end |
Instance Attribute Details
#content ⇒ Object (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_type ⇒ Object
46 47 48 |
# File 'lib/deas/show_exceptions.rb', line 46 def mime_type @mime_type ||= "text/plain" end |
#size ⇒ Object
42 43 44 |
# File 'lib/deas/show_exceptions.rb', line 42 def size @size ||= Rack::Utils.bytesize(self.content) end |