Class: CoderDecorator::Coders::Rescue

Inherits:
Coder
  • Object
show all
Defined in:
lib/coder_decorator/coders/rescue.rb

Overview

When there’s exception raised, it rescues and returns nil.

Instance Attribute Summary

Attributes inherited from Coder

#coder

Instance Method Summary collapse

Methods inherited from Coder

#initialize

Constructor Details

This class inherits a constructor from CoderDecorator::Coders::Coder

Instance Method Details

#decode(obj) ⇒ Object



12
13
14
15
16
# File 'lib/coder_decorator/coders/rescue.rb', line 12

def decode(obj)
  coder.decode(obj)
rescue StandardError
  nil
end

#encode(obj) ⇒ Object

:nodoc:



8
9
10
# File 'lib/coder_decorator/coders/rescue.rb', line 8

def encode(obj)
  coder.encode(obj)
end