Module: Serega::SeregaMap::ClassMethods

Included in:
Serega::SeregaMap
Defined in:
lib/serega/map.rb

Overview

SeregaMap class methods

Instance Method Summary collapse

Instance Method Details

#call(opts) ⇒ Array<Serega::SeregaMapPoint>

Constructs map of attributes that should be serialized.

Parameters:

  • opts

    Serialization parameters

Options Hash (opts):

  • :only (Hash)

    The only attributes to serialize

  • :except (Hash)

    Attributes to hide

  • :with (Hash)

    Attributes (usually hidden) to serialize additionally

Returns:



23
24
25
26
27
28
# File 'lib/serega/map.rb', line 23

def call(opts)
  max_cache_size = serializer_class.config.max_cached_map_per_serializer_count
  return map_for(opts) if max_cache_size.zero?

  cached_map_for(opts, max_cache_size)
end