Module: Serega::SeregaPlugins::ContextMetadata
- Defined in:
- lib/serega/plugins/context_metadata/context_metadata.rb
Defined Under Namespace
Modules: CheckSerializeParamsClassMethods, SeregaConvertInstanceMethods
Constant Summary
collapse
- DEFAULT_CONTEXT_METADATA_KEY =
:meta
Class Method Summary
collapse
Class Method Details
.after_load_plugin(serializer_class, **opts) ⇒ Object
21
22
23
24
25
26
|
# File 'lib/serega/plugins/context_metadata/context_metadata.rb', line 21
def self.after_load_plugin(serializer_class, **opts)
config = serializer_class.config
meta_key = opts[:context_metadata_key] || DEFAULT_CONTEXT_METADATA_KEY
config[plugin_name] = {key: meta_key}
config[:serialize_keys] << meta_key
end
|
.before_load_plugin(serializer_class, **opts) ⇒ Object
12
13
14
|
# File 'lib/serega/plugins/context_metadata/context_metadata.rb', line 12
def self.before_load_plugin(serializer_class, **opts)
serializer_class.plugin(:root, **opts) unless serializer_class.plugin_used?(:root)
end
|
.load_plugin(serializer_class, **_opts) ⇒ Object
.plugin_name ⇒ Object
8
9
10
|
# File 'lib/serega/plugins/context_metadata/context_metadata.rb', line 8
def self.plugin_name
:context_metadata
end
|