Sha256: c5fb951d51ac09bbedca69fce411d2f694e331fa398d0c55bf11f2af76fe8418

Contents?: true

Size: 455 Bytes

Versions: 5

Compression:

Stored size: 455 Bytes

Contents

# frozen_string_literal: true

require_relative 'csv_file_builder'
require_relative 'json_file_builder'

module BaseFileBuilder
  def export_to_file(file_name: 'tabled.csv', format: :csv)
    case format
    when :csv
      FileBuilders::CSVFileBuilder.new(data, file_name, options).export_to_file
    when :json
      FileBuilders::JSONFileBuilder.new(data, file_name, options).export_to_file
    else
      raise 'Not implemented yet'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tabled-1.2.1 lib/file_builders/base_file_builder.rb
tabled-1.2.0 lib/file_builders/base_file_builder.rb
tabled-1.1.0 lib/file_builders/base_file_builder.rb
tabled-1.0.0 lib/file_builders/base_file_builder.rb
tabled-0.0.6 lib/file_builders/base_file_builder.rb