Class: REXML::ReferenceWriter (Ruby 2.7.5)
Description: Class : REXML::ReferenceWriter - Ruby 2.7.5

### Home Classes Methods

### In Files

- rexml/doctype.rb

### Parent

Object

### Methods

- ::new
- #write

### Class/Module Index

Quicksearch

- Array
- Float
- Integer
- Object
- REXML
- REXML::AttlistDecl
- REXML::Attribute
- REXML::Attributes
- REXML::CData
- REXML::Child
- REXML::Comment
- REXML::DTD
- REXML::DTD::AttlistDecl
- REXML::DTD::ElementDecl
- REXML::DTD::EntityDecl
- REXML::DTD::NotationDecl
- REXML::DTD::Parser
- REXML::Declaration
- REXML::DocType
- REXML::Document
- REXML::Element
- REXML::ElementDecl
- REXML::Elements
- REXML::Encoding
- REXML::Entity
- REXML::EntityConst
- REXML::ExternalEntity
- REXML::Formatters
- REXML::Formatters::Default
- REXML::Formatters::Pretty
- REXML::Formatters::Transitive
- REXML::Functions
- REXML::IOSource
- REXML::Instruction
- REXML::Light
- REXML::Light::Node
- REXML::Namespace
- REXML::Node
- REXML::NotationDecl
- REXML::Output
- REXML::Parent
- REXML::ParseException
- REXML::Parsers
- REXML::Parsers::BaseParser
- REXML::Parsers::LightParser
- REXML::Parsers::PullEvent
- REXML::Parsers::PullParser
- REXML::Parsers::SAX2Parser
- REXML::Parsers::StreamParser
- REXML::Parsers::TreeParser
- REXML::Parsers::UltraLightParser
- REXML::Parsers::XPathParser
- REXML::QuickPath
- REXML::ReferenceWriter
- REXML::SAX2Listener
- REXML::Security
- REXML::Source
- REXML::SourceFactory
- REXML::StreamListener
- REXML::Text
- REXML::UndefinedNamespaceException
- REXML::Validation
- REXML::Validation::Choice
- REXML::Validation::Event
- REXML::Validation::Interleave
- REXML::Validation::OneOrMore
- REXML::Validation::Optional
- REXML::Validation::Ref
- REXML::Validation::RelaxNG
- REXML::Validation::Sequence
- REXML::Validation::State
- REXML::Validation::ValidationException
- REXML::Validation::Validator
- REXML::Validation::ZeroOrMore
- REXML::XMLDecl
- REXML::XMLTokens
- REXML::XPath
- REXML::XPathNode
- REXML::XPathParser
- Symbol

No matching classes.

# REXML::ReferenceWriter

### Public Class Methods

new(id_type, public_id_literal, system_literal, context=nil) click to toggle source

                   # File rexml/doctype.rb, line 11
    def initialize(id_type,
                   public_id_literal,
                   system_literal,
                   context=nil)
      @id_type = id_type
      @public_id_literal = public_id_literal
      @system_literal = system_literal
      if context and context[:prologue_quote] == :apostrophe
        @default_quote = "'"
      else
        @default_quote = "\""
      end
    end

### Public Instance Methods

write(output) click to toggle source

                   # File rexml/doctype.rb, line 25
    def write(output)
      output << " #{@id_type}"
      if @public_id_literal
        if @public_id_literal.include?("'")
          quote = "\""
        else
          quote = @default_quote
        end
        output << " #{quote}#{@public_id_literal}#{quote}"
      end
      if @system_literal
        if @system_literal.include?("'")
          quote = "\""
        elsif @system_literal.include?("\"")
          quote = "'"
        else
          quote = @default_quote
        end
        output << " #{quote}#{@system_literal}#{quote}"
      end
    end