Exception: Grape::Exceptions::Base
- Inherits:
-
StandardError
- Object
- StandardError
- Grape::Exceptions::Base
- Defined in:
- lib/grape/exceptions/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #[](index) ⇒ Object
-
#initialize(args = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(args = {}) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 |
# File 'lib/grape/exceptions/base.rb', line 6 def initialize(args = {}) @status = args[:status] || nil @message = args[:message] || nil @headers = args[:headers] || nil end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
4 5 6 |
# File 'lib/grape/exceptions/base.rb', line 4 def headers @headers end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/grape/exceptions/base.rb', line 4 def @message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/grape/exceptions/base.rb', line 4 def status @status end |
Instance Method Details
#[](index) ⇒ Object
12 13 14 |
# File 'lib/grape/exceptions/base.rb', line 12 def [](index) self.send(index) end |