Class: Serega::SeregaPlugins::Root::RootConfig
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::Root::RootConfig
- Defined in:
- lib/serega/plugins/root/root.rb
Overview
Root config object
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Serega::SeregaPlugins::Root::RootConfig
constructor
Initializes RootConfig object.
-
#many ⇒ Symbol, ...
Defined root for many-objects serialization.
-
#many=(value) ⇒ Symbol, ...
Set root for multiple-object serialization.
-
#one ⇒ Symbol, ...
Defined root for single-object serialization.
-
#one=(value) ⇒ Symbol, ...
Set root for single-object serialization.
Constructor Details
#initialize(opts) ⇒ Serega::SeregaPlugins::Root::RootConfig
Initializes RootConfig object
132 133 134 |
# File 'lib/serega/plugins/root/root.rb', line 132 def initialize(opts) @opts = opts end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
121 122 123 |
# File 'lib/serega/plugins/root/root.rb', line 121 def opts @opts end |
Instance Method Details
#many ⇒ Symbol, ...
Returns defined root for many-objects serialization.
142 143 144 |
# File 'lib/serega/plugins/root/root.rb', line 142 def many opts.fetch(:many) end |
#many=(value) ⇒ Symbol, ...
Set root for multiple-object serialization
162 163 164 |
# File 'lib/serega/plugins/root/root.rb', line 162 def many=(value) opts[:many] = value end |
#one ⇒ Symbol, ...
Returns defined root for single-object serialization.
137 138 139 |
# File 'lib/serega/plugins/root/root.rb', line 137 def one opts.fetch(:one) end |
#one=(value) ⇒ Symbol, ...
Set root for single-object serialization
152 153 154 |
# File 'lib/serega/plugins/root/root.rb', line 152 def one=(value) opts[:one] = value end |