Module: LightSerializer::Helpers::WithCustomRoot

Included in:
LightSerializer::HashedObject, SerializeCollection
Defined in:
lib/light_serializer/helpers/with_custom_root.rb

Instance Method Summary collapse

Instance Method Details

#with_custom_root(root) ⇒ Object



6
7
8
# File 'lib/light_serializer/helpers/with_custom_root.rb', line 6

def with_custom_root(root)
  root ? { root.to_sym => yield } : yield
end