Module: Surrealist::Wrapper
- Defined in:
- lib/surrealist/wrapper.rb
Overview
A helper class for wrapping hashes.
Class Method Summary collapse
-
.wrap(hash, carrier, klass: false) ⇒ Hash
Wraps the schema hash into root/namespaces if there is a need to.
Class Method Details
.wrap(hash, carrier, klass: false) ⇒ Hash
Wraps the schema hash into root/namespaces if there is a need to.
14 15 16 17 18 19 20 21 22 |
# File 'lib/surrealist/wrapper.rb', line 14 def wrap(hash, carrier, klass: false) namespaces_condition = carrier.include_namespaces || carrier.namespaces_nesting_level != DEFAULT_NESTING_LEVEL # rubocop:disable Layout/LineLength if !klass && (carrier.include_root || namespaces_condition) Surrealist::ExceptionRaiser.raise_unknown_root! end possibly_wrapped_hash(hash, klass, carrier, namespaces_condition) end |