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.6.12 lib/bolognese/writers/csv_writer.rb
bolognese-1.6.11 lib/bolognese/writers/csv_writer.rb
bolognese-1.6.10 lib/bolognese/writers/csv_writer.rb
bolognese-1.6.9 lib/bolognese/writers/csv_writer.rb
bolognese-1.6.8 lib/bolognese/writers/csv_writer.rb
bolognese-1.6.7 lib/bolognese/writers/csv_writer.rb
bolognese-1.6.6 lib/bolognese/writers/csv_writer.rb
bolognese-1.6.5 lib/bolognese/writers/csv_writer.rb
bolognese-1.6.4 lib/bolognese/writers/csv_writer.rb
bolognese-1.6.3 lib/bolognese/writers/csv_writer.rb
bolognese-1.6.2 lib/bolognese/writers/csv_writer.rb
bolognese-1.6 lib/bolognese/writers/csv_writer.rb
bolognese-1.5.21 lib/bolognese/writers/csv_writer.rb
bolognese-1.5.19 lib/bolognese/writers/csv_writer.rb
bolognese-1.5.17 lib/bolognese/writers/csv_writer.rb
bolognese-1.5.16 lib/bolognese/writers/csv_writer.rb
bolognese-1.5.15 lib/bolognese/writers/csv_writer.rb
bolognese-1.5.14 lib/bolognese/writers/csv_writer.rb
bolognese-1.5.13 lib/bolognese/writers/csv_writer.rb
bolognese-1.5.11 lib/bolognese/writers/csv_writer.rb