In Files

  • rdoc/ri/ri_formatter.rb

Parent

Files

Class/Module Index [+]

Quicksearch

RI::AttributeFormatter::AttributeString

Attributes

txt[R]

Public Class Methods

new() click to toggle source
 
               # File rdoc/ri/ri_formatter.rb, line 270
def initialize
  @txt = []
  @optr = 0
end
            

Public Instance Methods

<<(char) click to toggle source
 
               # File rdoc/ri/ri_formatter.rb, line 275
def <<(char)
  @txt << char
end
            
empty?() click to toggle source
 
               # File rdoc/ri/ri_formatter.rb, line 279
def empty?
  @optr >= @txt.length
end
            
next_word() click to toggle source

accept non space, then all following spaces

 
               # File rdoc/ri/ri_formatter.rb, line 284
def next_word
  start = @optr
  len = @txt.length

  while @optr < len && @txt[@optr].char != " "
    @optr += 1
  end

  while @optr < len && @txt[@optr].char == " "
    @optr += 1
  end

  @txt[start...@optr]
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