Module: Serega::SeregaPlugins::Root
- Defined in:
- lib/serega/plugins/root/root.rb
Defined Under Namespace
Modules: ClassMethods, SeregaConvertInstanceMethods
Constant Summary
collapse
- ROOT_DEFAULT =
Returns Default response root key.
:data
Class Method Summary
collapse
Class Method Details
.after_load_plugin(serializer_class, **opts) ⇒ Object
18
19
20
21
|
# File 'lib/serega/plugins/root/root.rb', line 18
def self.after_load_plugin(serializer_class, **opts)
serializer_class.root(opts[:root] || ROOT_DEFAULT, one: opts[:root_one], many: opts[:root_many])
serializer_class.config[:serialize_keys] << :root
end
|
.load_plugin(serializer_class, **_opts) ⇒ Object
13
14
15
16
|
# File 'lib/serega/plugins/root/root.rb', line 13
def self.load_plugin(serializer_class, **_opts)
serializer_class.extend(ClassMethods)
serializer_class::SeregaConvert.include(SeregaConvertInstanceMethods)
end
|
.plugin_name ⇒ Object
9
10
11
|
# File 'lib/serega/plugins/root/root.rb', line 9
def self.plugin_name
:root
end
|