Sha256: 74d5783501f74767215d8eb613ac6e1f53a9de3c19aea2048c2dec662d26fbe4

Contents?: true

Size: 686 Bytes

Versions: 17

Compression:

Stored size: 686 Bytes

Contents

# frozen_string_literal: true

module Briard
  module Writers
    module CsvWriter
      require 'csv'

      def csv
        return nil unless valid?

        bib = {
          doi: doi,
          url: url,
          registered: get_iso8601_date(date_registered),
          state: state,
          resource_type_general: types['resourceTypeGeneral'],
          resource_type: types['resourceType'],
          title: parse_attributes(titles, content: 'title', first: true),
          author: authors_as_string(creators),
          publisher: publisher,
          publication_year: publication_year
        }.values

        CSV.generate { |csv| csv << bib }
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
briard-2.9.4 lib/briard/writers/csv_writer.rb
briard-2.9.3 lib/briard/writers/csv_writer.rb
briard-2.9.2 lib/briard/writers/csv_writer.rb
briard-2.9.1 lib/briard/writers/csv_writer.rb
briard-2.9.0 lib/briard/writers/csv_writer.rb
briard-2.8.2 lib/briard/writers/csv_writer.rb
briard-2.8.1 lib/briard/writers/csv_writer.rb
briard-2.8.0 lib/briard/writers/csv_writer.rb
briard-2.7.1 lib/briard/writers/csv_writer.rb
briard-2.7.0 lib/briard/writers/csv_writer.rb
briard-2.6.7 lib/briard/writers/csv_writer.rb
briard-2.6.6 lib/briard/writers/csv_writer.rb
briard-2.6.5 lib/briard/writers/csv_writer.rb
briard-2.6.4 lib/briard/writers/csv_writer.rb
briard-2.6.2 lib/briard/writers/csv_writer.rb
briard-2.6.1 lib/briard/writers/csv_writer.rb
briard-2.6.0 lib/briard/writers/csv_writer.rb