A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://ruby.github.io/rdoc/RDoc/Context/Section.html below:

class RDoc::Context::Section - rdoc Documentation

  1. RDoc::
  2. Context::
  3. Section
class RDoc::Context::Section

A section of documentation like:


Sections can be referenced multiple times and will be collapsed into a single section.

Attributes Public Class Methods

Source

def initialize(parent, title, comment)
  @parent = parent
  @title = title ? title.strip : title

  @comments = []

  add_comment comment
end

Creates a new section with title and comment

Public Instance Methods

Source

def ==(other)
  self.class === other and @title == other.title
end

Sections are equal when they have the same title

Source

def aref
  title = @title || '[untitled]'

  CGI.escape(title).gsub('%', '-').sub(/^-/, '')
end

Anchor reference for linking to this section

Source

def in_files
  @comments.map(&:file)
end

The files comments in this section come from

Source

def marshal_dump
  [
    MARSHAL_VERSION,
    @title,
    parse,
  ]
end

Serializes this Section. The title and parsed comment are saved, but not the section parent which must be restored manually.

Source

def marshal_load(array)
  @parent  = nil

  @title    = array[1]
  @comments = array[2].parts.map { |doc| RDoc::Comment.from_document(doc) }
end

De-serializes this Section. The section parent must be restored manually.

Source

def parse
  RDoc::Markup::Document.new(*@comments.map(&:parse))
end

Parses comment_location into an RDoc::Markup::Document composed of multiple RDoc::Markup::Documents with their file set.

Source

def plain_html
  @title || 'Top Section'
end

The section’s title, or ‘Top Section’ if the title is nil.

This is used by the table of contents template so the name is silly.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4