Module: Doing::StringTruncate
- Included in:
- String
- Defined in:
- lib/doing/string/truncate.rb
Overview
String truncation
Instance Method Summary collapse
- 
  
    
      #trunc(len, ellipsis: '...')  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Truncate to nearest word. 
- #trunc!(len, ellipsis: '...') ⇒ Object
- 
  
    
      #truncend(len, ellipsis: '...')  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Truncate from middle to end at nearest word. 
- #truncend!(len, ellipsis: '...') ⇒ Object
- 
  
    
      #truncmiddle(len, ellipsis: '...')  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Truncate string in the middle, separating at nearest word. 
- #truncmiddle!(len, ellipsis: '...') ⇒ Object
Instance Method Details
#trunc(len, ellipsis: '...') ⇒ Object
Truncate to nearest word
#trunc!(len, ellipsis: '...') ⇒ Object
#truncend(len, ellipsis: '...') ⇒ Object
Truncate from middle to end at nearest word
#truncend!(len, ellipsis: '...') ⇒ Object
#truncmiddle(len, ellipsis: '...') ⇒ Object
Truncate string in the middle, separating at nearest word