Method: RubyCurses::TextView#row_length

Defined in:
lib/rbcurse/core/widgets/rtextview.rb

#row_lengthObject

determine length of row since we have chunks now. Since chunk implements length, so not required except for the old cases of demos that use an array.



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/rbcurse/core/widgets/rtextview.rb', line 250

def row_length
  case @buffer
  when String
    @buffer.length
  when Chunks::ChunkLine
    return @buffer.length
  when Array
    # this is for those old cases like rfe.rb which sent in an array
    # (before we moved to chunks) 
    # line is an array of arrays
    if @buffer[0].is_a? Array
      result = 0
      @buffer.each {|e| result += e[1].length  }
      return result
    end
    # line is one single chunk
    return @buffer[1].length
  end
end