class Asciidoctor::Document::Title - asciidoctor-1.5.6.2 Documentation

# class Asciidoctor::Document::Title

Public Parsed and stores a partitioned title (i.e., title & subtitle).

### Attributes

combined[R]
main[R]
subtitle[R]
title[R]

### Public Class Methods

new(val, opts = {}) click to toggle source

    # File lib/asciidoctor/document.rb, line 45
    def initialize val, opts = {}
      # TODO separate sanitization by type (:cdata for HTML/XML, :plain_text for non-SGML, false for none)
      if (@sanitized = opts[:sanitize]) && val.include?('<')
        val = val.gsub(XmlSanitizeRx, '').squeeze(' ').strip
      end
      if (sep = opts[:separator] || ':').empty? || !val.include?(sep = %Q(#{sep} ))
        @main = val
        @subtitle = nil
      else
        @main, _, @subtitle = val.rpartition sep
      end
      @combined = val
    end

### Public Instance Methods

sanitized?() click to toggle source

    # File lib/asciidoctor/document.rb, line 59
    def sanitized?
      @sanitized
    end

subtitle?() click to toggle source

    # File lib/asciidoctor/document.rb, line 63
    def subtitle?
      @subtitle ? true : false
    end

to_s() click to toggle source

    # File lib/asciidoctor/document.rb, line 67
    def to_s
      @combined
    end