Module: Serega::SeregaPlugins::Root::ConfigInstanceMethods

Defined in:
lib/serega/plugins/root/root.rb

Overview

Serega::SeregaConfig additional/patched class methods

Instance Method Summary collapse

Instance Method Details

#rootSerega::SeregaPlugins::Root::RootConfig

Returns current root config.

Returns:



174
175
176
# File 'lib/serega/plugins/root/root.rb', line 174

def root
  @root ||= RootConfig.new(opts.fetch(:root))
end

#root=(value) ⇒ void

This method returns an undefined value.

Set root for one-object and many-objects serialization types

Parameters:

  • value (Hash)

Options Hash (value):

  • :one (Symbol, String, nil)

    Root for one-object serialization type

  • :many (Symbol, String, nil)

    Root for many-objects serialization type



185
186
187
188
# File 'lib/serega/plugins/root/root.rb', line 185

def root=(value)
  root.one = value.fetch(:one)
  root.many = value.fetch(:many)
end