Exception: Startback::Errors::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Startback::Errors::Error
show all
- Defined in:
- lib/startback/errors.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.keep_error(keep = nil) ⇒ Object
15
16
17
18
|
# File 'lib/startback/errors.rb', line 15
def keep_error(keep = nil)
@keep_error = keep unless keep.nil?
@keep_error
end
|
.status(code = nil) ⇒ Object
7
8
9
10
11
12
13
|
# File 'lib/startback/errors.rb', line 7
def status(code = nil)
if code.nil?
@code || (superclass.respond_to?(:status) ? superclass.status : 500)
else
@code = code || @code
end
end
|
Instance Method Details
#message ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'lib/startback/errors.rb', line 21
def message
msg = super
return msg unless msg == self.class.name
parts = self.class.name.split('::').last.gsub(/[A-Z]/){|x|
" #{x.downcase}"
}.strip.split(" ")
parts = parts[0...-1] unless self.class.keep_error
parts.join(" ").capitalize
end
|