Class
Class Methods
lib/rexml/doctype.rb
View on GitHub
# File tmp/rubies/ruby-2.6.10/lib/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
No documentation available
Instance Methods
lib/rexml/doctype.rb
View on GitHub
# File tmp/rubies/ruby-2.6.10/lib/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
No documentation available