Sha256: 8c52dc9c46ca182827d8638457be2676c14e67b0c8955ef8e53b1245adbc97ac

Contents?: true

Size: 715 Bytes

Versions: 24

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

require 'iso_bib_item/localized_string'

module IsoBibItem
  # Formatted string
  class FormattedString < LocalizedString
    # @return [String]
    attr_reader :type

    # @param content [String]
    # @param language [String] language code Iso639
    # @param script [String] script code Iso15924
    # @param type [String] the format type, default "plain"
    #   available types "plain", "html", "dockbook", "tei", "asciidoc",
    #   "markdown", "isodoc"
    def initialize(content:, language:, script:, type: 'plain')
      super(content, language, script)
      @type = type
    end

    def to_xml(builder)
      builder.parent['format'] = type
      super
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
iso-bib-item-0.4.3 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.4.2 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.4.1 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.4.0 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.3.1 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.3.0 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.2.5 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.2.4 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.2.3 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.2.2 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.2.1 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.2.0 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.1.11 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.1.10 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.1.9 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.1.8 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.1.7 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.1.6 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.1.5 lib/iso_bib_item/formatted_string.rb
iso-bib-item-0.1.4 lib/iso_bib_item/formatted_string.rb