A container for all the lines
# File rdoc/markup/simple_markup/lines.rb, line 143
def as_text
@lines.map {|l| l.text}.join("\n")
end
# File rdoc/markup/simple_markup/lines.rb, line 133
def delete(a_line)
a_line.deleted = true
end
# File rdoc/markup/simple_markup/lines.rb, line 107
def each
@lines.each do |line|
yield line unless line.deleted
end
end
# File rdoc/markup/simple_markup/lines.rb, line 103
def empty?
@lines.size.zero?
end
# File rdoc/markup/simple_markup/lines.rb, line 147
def line_types
@lines.map {|l| l.type }
end
# File rdoc/markup/simple_markup/lines.rb, line 121
def next
begin
res = @lines[@nextline]
@nextline += 1 if @nextline < @lines.size
end while res and res.deleted and @nextline < @lines.size
res
end
# File rdoc/markup/simple_markup/lines.rb, line 137
def normalize
margin = @lines.collect{|l| l.leading_spaces}.min
margin = 0 if margin == Line::INFINITY
@lines.each {|line| line.strip_leading(margin) } if margin > 0
end
Commenting is here to help enhance the documentation. For example, sample code, or clarification of the documentation.
If you are posting code samples in your comments, please wrap them in "<pre><code class="ruby" > ... </code></pre>" markup in order to get syntax highlighting.
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 a bug report so that it can be corrected for the next release. Thank you.