Exception: Renderror::BaseError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Renderror::BaseError
show all
- Defined in:
- lib/renderror/base_error.rb
Instance Method Summary
collapse
Constructor Details
#initialize(title: default_title, detail: default_detail, pointer: nil) ⇒ BaseError
Returns a new instance of BaseError.
3
4
5
6
7
|
# File 'lib/renderror/base_error.rb', line 3
def initialize(title: default_title, detail: default_detail, pointer: nil)
@title = title
@detail = detail
@pointer = pointer
end
|
Instance Method Details
#detail ⇒ Object
26
27
28
|
# File 'lib/renderror/base_error.rb', line 26
def detail
@detail ||= I18n.t(:"renderror.base_error.detail")
end
|
#pointer ⇒ Object
30
31
32
|
# File 'lib/renderror/base_error.rb', line 30
def pointer
@pointer ||= nil
end
|
#status ⇒ Object
18
19
20
|
# File 'lib/renderror/base_error.rb', line 18
def status
@status ||= I18n.t(:"renderror.base_error.status")
end
|
#title ⇒ Object
22
23
24
|
# File 'lib/renderror/base_error.rb', line 22
def title
@title ||= I18n.t(:"renderror.base_error.title")
end
|
#to_json ⇒ Object
9
10
11
12
13
14
15
16
|
# File 'lib/renderror/base_error.rb', line 9
def to_json
{
'status' => status,
'title' => title,
'detail' => detail,
'pointer' => pointer
}
end
|