# File lib/grape_entity/exposure/nesting_exposure/output_builder.rb, line 11 def add(exposure, result) # Save a result array in collections' array if it should be merged if result.is_a?(Array) && exposure.for_merge @output_collection << result elsif exposure.for_merge # If we have an array which should not be merged - save it with a key as a hash # If we have hash which should be merged - save it without a key (merge) return unless result @output_hash.merge! result, &merge_strategy(exposure.for_merge) else @output_hash[exposure.key] = result end end