Sha256: 34db0dc0a8d8608a0f72a158df56e573e3225342c3e5e820c8a5dd5692e168c0

Contents?: true

Size: 658 Bytes

Versions: 129

Compression:

Stored size: 658 Bytes

Contents

module Bolognese
  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

129 entries across 129 versions & 1 rubygems

Version Path
bolognese-1.11.5 lib/bolognese/writers/csv_writer.rb
bolognese-1.11.4 lib/bolognese/writers/csv_writer.rb
bolognese-1.11.3 lib/bolognese/writers/csv_writer.rb
bolognese-1.11.2 lib/bolognese/writers/csv_writer.rb
bolognese-1.11.0 lib/bolognese/writers/csv_writer.rb
bolognese-1.10.0 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.18 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.17 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.14 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.13 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.12 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.11 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.10 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.9 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.8 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.7 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.6 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.5 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.4 lib/bolognese/writers/csv_writer.rb
bolognese-1.9.3 lib/bolognese/writers/csv_writer.rb