Exception: Mojito::MojitoException
- Inherits:
-
Exception
- Object
- Exception
- Mojito::MojitoException
- Defined in:
- lib/mojito/helpers/exception_handling.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status = 500, message = STATUS[status].message) ⇒ MojitoException
constructor
A new instance of MojitoException.
- #to_response ⇒ Object
Constructor Details
#initialize(status = 500, message = STATUS[status].message) ⇒ MojitoException
Returns a new instance of MojitoException.
7 8 9 10 |
# File 'lib/mojito/helpers/exception_handling.rb', line 7 def initialize(status = 500, = STATUS[status].) super() @status = Mojito::STATUS[status].code end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/mojito/helpers/exception_handling.rb', line 12 def status @status end |
Instance Method Details
#to_response ⇒ Object
14 15 16 |
# File 'lib/mojito/helpers/exception_handling.rb', line 14 def to_response Rack::Response.new [], status, 'Content-Type' => 'application/octet-stream' end |