Module: Codecs::NilableCodec
- Defined in:
- lib/emery/codecs.rb
Class Method Summary collapse
- .applicable?(type) ⇒ Boolean
- .deserialize(type, json_value) ⇒ Object
- .serialize(type, value) ⇒ Object
Class Method Details
.applicable?(type) ⇒ Boolean
97 98 99 |
# File 'lib/emery/codecs.rb', line 97 def self.applicable?(type) type.instance_of? T::NilableType end |
.deserialize(type, json_value) ⇒ Object
100 101 102 103 104 105 106 |
# File 'lib/emery/codecs.rb', line 100 def self.deserialize(type, json_value) if json_value != nil Jsoner.deserialize(type.inner_type, json_value) else nil end end |