Exception: Neoway::Auth::BaseError
- Inherits:
-
StandardError
- Object
- StandardError
- Neoway::Auth::BaseError
- Defined in:
- lib/neoway/auth/base_error.rb
Direct Known Subclasses
AuthenticationError, BadRequestError, InvalidCredentialsError, ServerError, UnexpectedError
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message = self.class.default_message) ⇒ BaseError
constructor
A new instance of BaseError.
Constructor Details
#initialize(message = self.class.default_message) ⇒ BaseError
Returns a new instance of BaseError.
6 7 8 |
# File 'lib/neoway/auth/base_error.rb', line 6 def initialize( = self.class.) super() end |
Class Method Details
.default_message ⇒ Object
10 11 12 13 14 |
# File 'lib/neoway/auth/base_error.rb', line 10 def self. name = self.name.dup I18n.t("errors.#{underscore(name)}") end |
.underscore(str) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/neoway/auth/base_error.rb', line 16 def self.underscore(str) str.gsub(/::/, ".") .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2') .tr("-", "_") .downcase end |