Module: Sanity::Serializable

Included in:
Resource
Defined in:
lib/sanity/serializable.rb

Overview

Serializable is responsible for configuring auto serialization or a default serializer. It also defines the default class serializer used when auto serialization is enabled.

The auto_serialize macro is used to enable auto serialization.

The serializer marco is used to define the default serializer.

Examples:

enables auto serialization

auto_serialize

default to using a custom defined UserSerializer

serializer UserSerializer

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



20
21
22
# File 'lib/sanity/serializable.rb', line 20

def included(base)
  base.extend(ClassMethods)
end