Exception: WebFunction::Error Private
- Inherits:
-
StandardError
- Object
- StandardError
- WebFunction::Error
- Defined in:
- lib/web_function.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A base error class for WebFunction. All errors inherit from this class.
Instance Attribute Summary collapse
- #code ⇒ Object readonly private
- #details ⇒ Object readonly private
Class Method Summary collapse
-
.error_code ⇒ String
private
Returns the error code for the error.
Instance Method Summary collapse
-
#initialize(message = nil, code: self.class.error_code, details: nil) ⇒ Error
constructor
private
A new instance of Error.
Constructor Details
#initialize(message = nil, code: self.class.error_code, details: nil) ⇒ Error
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Error.
28 29 30 31 32 |
# File 'lib/web_function.rb', line 28 def initialize( = nil, code: self.class.error_code, details: nil) super() @code = code @details = details end |
Instance Attribute Details
#code ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/web_function.rb', line 26 def code @code end |
#details ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/web_function.rb', line 26 def details @details end |
Class Method Details
.error_code ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the error code for the error. Used as default error code if no code is provided.
38 39 40 41 42 |
# File 'lib/web_function.rb', line 38 def self.error_code name.sub(/^WebFunction::/, "WFN_") .gsub(/([a-z\d])([A-Z])/, '\1_\2') .upcase end |