class RDoc::Markup::Verbatim
A section of verbatim text
Attributes
Format of this verbatim section
: Symbol?
Public Instance Methods
Source
# File lib/rdoc/markup/verbatim.rb, line 25 def accept(visitor) visitor.accept_verbatim self end
Calls #accept_verbatim on +visitor+ @override
: (untyped) -> void
Source
# File lib/rdoc/markup/verbatim.rb, line 31 def normalize # Chunk the parts into groups of entries that are only line breaks and other content. For line break groups, # take only 1 parts = @parts .chunk { |part| part.match?(/^\s*\n/) } .flat_map { |is_newline, group| is_newline ? group.take(1) : group } # Remove any trailing line breaks parts.pop if @parts.last&.match?(/\A\r?\n\z/) @parts = parts end
Collapses 2+ newlines into a single one
: () -> void
Source
# File lib/rdoc/markup/verbatim.rb, line 62 def ruby? @format ||= nil # TODO for older ri data, switch the tree to marshal_dump @format == :ruby end
Is this verbatim section Ruby code?
: () -> bool
Source
# File lib/rdoc/markup/verbatim.rb, line 69 def text @parts.join end
The text of the section
: () -> String