In Files

  • rdoc/markup/fragments.rb

Files

Class/Module Index [+]

Quicksearch

RDoc::Markup::LineCollection

Collect groups of lines together. Each group will end up containing a flow of text.

Public Class Methods

new() click to toggle source
 
               # File rdoc/markup/fragments.rb, line 135
def initialize
  @fragments = []
end
            

Public Instance Methods

accept(am, visitor) click to toggle source
 
               # File rdoc/markup/fragments.rb, line 172
def accept(am, visitor)
  visitor.start_accepting

  @fragments.each do |fragment|
    case fragment
    when Verbatim
      visitor.accept_verbatim(am, fragment)
    when Rule
      visitor.accept_rule(am, fragment)
    when ListStart
      visitor.accept_list_start(am, fragment)
    when ListEnd
      visitor.accept_list_end(am, fragment)
    when ListItem
      visitor.accept_list_item(am, fragment)
    when BlankLine
      visitor.accept_blank_line(am, fragment)
    when Heading
      visitor.accept_heading(am, fragment)
    when Paragraph
      visitor.accept_paragraph(am, fragment)
    end
  end

  visitor.end_accepting
end
            
add(fragment) click to toggle source
 
               # File rdoc/markup/fragments.rb, line 139
def add(fragment)
  @fragments << fragment
end
            
each(&b) click to toggle source
 
               # File rdoc/markup/fragments.rb, line 143
def each(&b)
  @fragments.each(&b)
end
            
fragment_for(*args) click to toggle source

Factory for different fragment types

 
               # File rdoc/markup/fragments.rb, line 154
def fragment_for(*args)
  Fragment.for(*args)
end
            
normalize() click to toggle source

Tidy up at the end

 
               # File rdoc/markup/fragments.rb, line 161
def normalize
  change_verbatim_blank_lines
  add_list_start_and_ends
  add_list_breaks
  tidy_blank_lines
end
            
to_s() click to toggle source
 
               # File rdoc/markup/fragments.rb, line 168
def to_s
  @fragments.join("\n----\n")
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus