module RocketJob module Category # Define the layout for each category of input or output data class Output include SemanticLogger::Loggable include Plugins::Document include Category::Base embedded_in :job, class_name: "RocketJob::Job", inverse_of: :output_categories # Whether to skip nil values returned from the `perform` method. # true: save nil values to the output categories. # false: do not save nil values to the output categories. field :nils, type: ::Mongoid::Boolean, default: false validates_inclusion_of :serializer, in: %i[none compress encrypt bz2 encrypted_bz2 bzip2] # Renders [String] the header line. # Returns [nil] if no header is needed. def render_header return if !tabular? || !tabular.requires_header? tabular.render_header end def data_store(job) RocketJob::Sliced::Output.new( collection_name: build_collection_name(:output, job), slice_class: serializer_class ) end end end end