Class: Paquito::TranslateErrors
- Inherits:
-
Object
- Object
- Paquito::TranslateErrors
- Defined in:
- lib/paquito/translate_errors.rb
Instance Method Summary collapse
- #dump(object) ⇒ Object
-
#initialize(coder) ⇒ TranslateErrors
constructor
A new instance of TranslateErrors.
- #load(payload) ⇒ Object
Constructor Details
#initialize(coder) ⇒ TranslateErrors
Returns a new instance of TranslateErrors.
5 6 7 |
# File 'lib/paquito/translate_errors.rb', line 5 def initialize(coder) @coder = Paquito.cast(coder) end |
Instance Method Details
#dump(object) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/paquito/translate_errors.rb', line 9 def dump(object) @coder.dump(object) rescue Paquito::Error raise rescue => error raise PackError, error. end |
#load(payload) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/paquito/translate_errors.rb', line 17 def load(payload) @coder.load(payload) rescue Paquito::Error raise rescue => error raise UnpackError, error. end |