[](*args)
            click to toggle source
          
          
          
  
            
            
            
            
            
               
               
def [](*args)
  result = @characters[*args]
  if result.respond_to?(:pack)
    result.pack("U*")
  else
    result
  end
end
             
             
            
           
          
          
         
      
        
          
          
          
            compute_width(start, _end)
            click to toggle source
          
          
          
  
            
            
            
            
            
               
               
def compute_width(start, _end)
  width = 0
  start.upto(_end - 1) do |i|
    if self.class.wide_character?(@characters[i])
      width += 2
    else
      width += 1
    end
  end
  width
end
             
             
            
           
          
          
         
      
        
          
          
          
            each(&block)
            click to toggle source
          
          
          
  
            
            
            
            
            
               
               
def each(&block)
  @characters.each(&block)
end
             
             
            
           
          
          
         
      
        
          
          
          
            size()
            click to toggle source
          
          
          
  
            
            
            
            
            
               
               
def size
  @characters.size
end
             
             
            
           
          
          
         
      
        
          
          
          
            to_s()
            click to toggle source