Exception: Bakong::Khqr::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Bakong::Khqr::Error
- Defined in:
- lib/bakong/khqr/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code:, message:) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(code:, message:) ⇒ Error
Returns a new instance of Error.
8 9 10 11 |
# File 'lib/bakong/khqr/error.rb', line 8 def initialize(code:, message:) @code = code super() end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/bakong/khqr/error.rb', line 6 def code @code end |
Class Method Details
.from(error_code) ⇒ Object
13 14 15 |
# File 'lib/bakong/khqr/error.rb', line 13 def self.from(error_code) new(code: error_code[:code], message: error_code[:message]) end |