Exception: MslmError
- Inherits:
-
StandardError
- Object
- StandardError
- MslmError
- Defined in:
- lib/mslm/mslm_errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(code, message) ⇒ MslmError
constructor
Initializes a new MslmError object with a code and a message.
-
#to_str ⇒ Object
Returns a string representation of the error.
Constructor Details
#initialize(code, message) ⇒ MslmError
Initializes a new MslmError object with a code and a message
5 6 7 8 |
# File 'lib/mslm/mslm_errors.rb', line 5 def initialize(code, ) @code = code = end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
2 3 4 |
# File 'lib/mslm/mslm_errors.rb', line 2 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
2 3 4 |
# File 'lib/mslm/mslm_errors.rb', line 2 def end |
Instance Method Details
#to_str ⇒ Object
Returns a string representation of the error
11 12 13 |
# File 'lib/mslm/mslm_errors.rb', line 11 def to_str "Error: code: #{@code}, message: #{@message}" end |