Class RI::AttributeFormatter::AttributeString
In: rdoc/ri/ri_formatter.rb
Parent: Object

Methods

<<   empty?   new   next_word  

Attributes

txt  [R] 

Public Class methods

[Source]

# File rdoc/ri/ri_formatter.rb, line 270
      def initialize
        @txt = []
        @optr = 0
      end

Public Instance methods

[Source]

# File rdoc/ri/ri_formatter.rb, line 275
      def <<(char)
        @txt << char
      end

[Source]

# File rdoc/ri/ri_formatter.rb, line 279
      def empty?
        @optr >= @txt.length
      end

accept non space, then all following spaces

[Source]

# 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

[Validate]

ruby-doc.org is a service of James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, AZ.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.