Module: Property::Serialization::JSON

Extended by:
Encoder
Includes:
Encoder
Defined in:
lib/property/serialization/json.rb

Overview

Use JSON to encode properties. This is the serialization best option. It’s the fastest and does not have any binary format issues. You just have to provide ‘self.create_json’ and ‘to_json’ methods for the classes you want to serialize.

Defined Under Namespace

Modules: Encoder, Validator

Class Method Summary collapse

Methods included from Encoder

decode_properties, encode_properties

Class Method Details

.included(base) ⇒ Object



42
43
44
45
# File 'lib/property/serialization/json.rb', line 42

def self.included(base)
  Property.validators << Validator
  base.extend Encoder
end