Class RDoc::RI::AttributeFormatter::AttributeString
In: ri/formatter.rb
Parent: Object

Methods

<<   empty?   new   next_word  

Public Class methods

[Source]

     # File ri/formatter.rb, line 241
241:     def initialize
242:       @txt = []
243:       @optr = 0
244:     end

Public Instance methods

[Source]

     # File ri/formatter.rb, line 246
246:     def <<(char)
247:       @txt << char
248:     end

[Source]

     # File ri/formatter.rb, line 250
250:     def empty?
251:       @optr >= @txt.length
252:     end

accept non space, then all following spaces

[Source]

     # File ri/formatter.rb, line 255
255:     def next_word
256:       start = @optr
257:       len = @txt.length
258: 
259:       while @optr < len && @txt[@optr].char != " "
260:         @optr += 1
261:       end
262: 
263:       while @optr < len && @txt[@optr].char == " "
264:         @optr += 1
265:       end
266: 
267:       @txt[start...@optr]
268:     end

[Validate]