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

Methods

<<   empty?   new   next_word  

Attributes

txt  [R] 

Public Class methods

[Source]

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

Public Instance methods

[Source]

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

[Source]

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

accept non space, then all following spaces

[Source]

     # File ri/ri_formatter.rb, line 284
284:       def next_word
285:         start = @optr
286:         len = @txt.length
287: 
288:         while @optr < len && @txt[@optr].char != " "
289:           @optr += 1
290:         end
291: 
292:         while @optr < len && @txt[@optr].char == " "
293:           @optr += 1
294:         end
295: 
296:         @txt[start...@optr]
297:       end

[Validate]