Sha256: 17148a21776d8a56df2081f6ea8e136e4aa448b981060a638b56ccbfdebc3942

Contents?: true

Size: 941 Bytes

Versions: 9

Compression:

Stored size: 941 Bytes

Contents

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,
          "AN" => parse_attributes(alternate_name, content: "name").presence,
          "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

9 entries across 9 versions & 1 rubygems

Version Path
bolognese-0.10.21 lib/bolognese/writers/ris_writer.rb
bolognese-0.10.20 lib/bolognese/writers/ris_writer.rb
bolognese-0.10.19 lib/bolognese/writers/ris_writer.rb
bolognese-0.10.18 lib/bolognese/writers/ris_writer.rb
bolognese-0.10.17 lib/bolognese/writers/ris_writer.rb
bolognese-0.10.16 lib/bolognese/writers/ris_writer.rb
bolognese-0.10.15 lib/bolognese/writers/ris_writer.rb
bolognese-0.10.14 lib/bolognese/writers/ris_writer.rb
bolognese-0.10.13 lib/bolognese/writers/ris_writer.rb