Module: Sanity::Serializable::ClassMethods

Defined in:
lib/sanity/serializable.rb

Instance Method Summary collapse

Instance Method Details

#auto_serialize?Boolean

Returns:

  • (Boolean)


35
36
37
38
39
# File 'lib/sanity/serializable.rb', line 35

def auto_serialize?
  return @auto_serialize if defined?(@auto_serialize)

  superclass.respond_to?(:auto_serialize?) && superclass.auto_serialize?
end

#default_serializerObject



26
27
28
29
30
31
32
33
# File 'lib/sanity/serializable.rb', line 26

def default_serializer
  @default_serializer ||=
    if auto_serialize?
      class_serializer
    elsif defined?(@serializer)
      @serializer
    end
end