Exception: Grape::Exceptions::Base

Inherits:
StandardError
  • Object
show all
Defined in:
lib/grape/exceptions/base.rb

Constant Summary collapse

BASE_MESSAGES_KEY =
'grape.errors.messages'
BASE_ATTRIBUTES_KEY =
'grape.errors.attributes'
FALLBACK_LOCALE =
:en

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Base

Returns a new instance of Base.



11
12
13
14
15
# File 'lib/grape/exceptions/base.rb', line 11

def initialize(args = {})
  @status = args[:status] || nil
  @message = args[:message] || nil
  @headers = args[:headers] || nil
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



9
10
11
# File 'lib/grape/exceptions/base.rb', line 9

def headers
  @headers
end

#messageObject (readonly)

Returns the value of attribute message.



9
10
11
# File 'lib/grape/exceptions/base.rb', line 9

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/grape/exceptions/base.rb', line 9

def status
  @status
end

Instance Method Details

#[](index) ⇒ Object



17
18
19
# File 'lib/grape/exceptions/base.rb', line 17

def [](index)
  send index
end