Exception: ApiException::BaseException
- Inherits:
-
StandardError
- Object
- StandardError
- ApiException::BaseException
- Includes:
- ActiveModel::Model, ActiveModel::Serialization
- Defined in:
- lib/api_exception/base_exception.rb
Direct Known Subclasses
ControllerException, FileException, ModelException, RequestException, ServiceException, UserException
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#error_type ⇒ Object
readonly
Returns the value of attribute error_type.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(error_type, errors, params = {}, platform = "API") ⇒ BaseException
constructor
A new instance of BaseException.
Constructor Details
#initialize(error_type, errors, params = {}, platform = "API") ⇒ BaseException
8 9 10 11 12 |
# File 'lib/api_exception/base_exception.rb', line 8 def initialize(error_type, errors, params = {}, platform = "API") @error = error_code_map[error_type] define_attributes(error_type, errors, params, platform) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/api_exception/base_exception.rb', line 6 def code @code end |
#error_type ⇒ Object (readonly)
Returns the value of attribute error_type.
6 7 8 |
# File 'lib/api_exception/base_exception.rb', line 6 def error_type @error_type end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/api_exception/base_exception.rb', line 6 def errors @errors end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'lib/api_exception/base_exception.rb', line 6 def @message end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/api_exception/base_exception.rb', line 6 def type @type end |