Module: LightSerializer::Helpers::WithCustomRoot
- Included in:
- LightSerializer::HashedObject, SerializeCollection
- Defined in:
- lib/light_serializer/helpers/with_custom_root.rb
Instance Method Summary collapse
-
#with_custom_root(root) ⇒ Object
:reek:UtilityFunction.
Instance Method Details
#with_custom_root(root) ⇒ Object
:reek:UtilityFunction
7 8 9 |
# File 'lib/light_serializer/helpers/with_custom_root.rb', line 7 def with_custom_root(root) root ? { root.to_s => yield } : yield end |