Sha256: 186a674e45490e651743aa62bfda3405de447b11415c6a3f2c97cf2bf0224ca4

Contents?: true

Size: 894 Bytes

Versions: 16

Compression:

Stored size: 894 Bytes

Contents

# frozen_string_literal: true

module Bolognese
  module Writers
    module RisWriter
      def ris
        {
          "TY" => ris_type,
          "T1" => parse_attributes(title, content: "text", first: true),
          "T2" => container_title,
          "AU" => to_ris(author),
          "DO" => doi,
          "UR" => b_url,
          "AB" => parse_attributes(description, content: "text", first: true),
          "KW" => Array.wrap(keywords).map { |k| parse_attributes(k, content: "text", first: true) }.presence,
          "PY" => publication_year,
          "PB" => publisher,
          "LA" => language,
          "VL" => volume,
          "IS" => issue,
          "SP" => first_page,
          "EP" => last_page,
          "ER" => ""
        }.compact.map { |k, v| v.is_a?(Array) ? v.map { |vi| "#{k}  - #{vi}" }.join("\r\n") : "#{k}  - #{v}" }.join("\r\n")
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bolognese-0.15.9 lib/bolognese/writers/ris_writer.rb
bolognese-0.15.8 lib/bolognese/writers/ris_writer.rb
bolognese-0.15.6 lib/bolognese/writers/ris_writer.rb
bolognese-0.15.3 lib/bolognese/writers/ris_writer.rb
bolognese-0.15.1 lib/bolognese/writers/ris_writer.rb
bolognese-0.14.1 lib/bolognese/writers/ris_writer.rb
bolognese-0.14 lib/bolognese/writers/ris_writer.rb
bolognese-0.13.6 lib/bolognese/writers/ris_writer.rb
bolognese-0.13.4 lib/bolognese/writers/ris_writer.rb
bolognese-0.13.3 lib/bolognese/writers/ris_writer.rb
bolognese-0.13.2 lib/bolognese/writers/ris_writer.rb
bolognese-0.13.1 lib/bolognese/writers/ris_writer.rb
bolognese-0.12.3 lib/bolognese/writers/ris_writer.rb
bolognese-0.12.2 lib/bolognese/writers/ris_writer.rb
bolognese-0.12.1 lib/bolognese/writers/ris_writer.rb
bolognese-0.12 lib/bolognese/writers/ris_writer.rb