Class: RDocF95::RI::AttributeFormatter::AttributeString
- Inherits:
-
Object
- Object
- RDocF95::RI::AttributeFormatter::AttributeString
- Defined in:
- lib/rdoc-f95/ri/formatter.rb
Instance Attribute Summary collapse
-
#txt ⇒ Object
readonly
Returns the value of attribute txt.
Instance Method Summary collapse
- #<<(char) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ AttributeString
constructor
A new instance of AttributeString.
-
#next_word ⇒ Object
accept non space, then all following spaces.
Constructor Details
#initialize ⇒ AttributeString
Returns a new instance of AttributeString.
241 242 243 244 |
# File 'lib/rdoc-f95/ri/formatter.rb', line 241 def initialize @txt = [] @optr = 0 end |
Instance Attribute Details
#txt ⇒ Object (readonly)
Returns the value of attribute txt.
239 240 241 |
# File 'lib/rdoc-f95/ri/formatter.rb', line 239 def txt @txt end |
Instance Method Details
#<<(char) ⇒ Object
246 247 248 |
# File 'lib/rdoc-f95/ri/formatter.rb', line 246 def <<(char) @txt << char end |
#empty? ⇒ Boolean
250 251 252 |
# File 'lib/rdoc-f95/ri/formatter.rb', line 250 def empty? @optr >= @txt.length end |
#next_word ⇒ Object
accept non space, then all following spaces
255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/rdoc-f95/ri/formatter.rb', line 255 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 |