krim/light_serializer

View on GitHub
lib/light_serializer/helpers/with_custom_root.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module LightSerializer
  module Helpers
    module WithCustomRoot
      # :reek:UtilityFunction
      def with_custom_root(root)
        root ? { root.to_s => yield } : yield
      end
    end
  end
end