Codeminer42/cm42-central

View on GitHub
lib/renderers/csv_options.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Renderers
  class CSVOptions
    def initialize(options = {})
      @options = options
    end

    def exporter
      @exporter ||= options[:exporter] || ::Exporters::Default
    end

    def filename
      @filename ||= options[:filename] || exporter.filename
    end

    def type
      Mime[:csv]
    end

    def attributes
      [exporter, filename, type]
    end

    private

    attr_reader :options
  end
end