Module: Doing::StringTruncate

Included in:
String
Defined in:
lib/doing/string/truncate.rb

Overview

String truncation

Instance Method Summary collapse

Instance Method Details

#trunc(len, ellipsis: '...') ⇒ Object

Truncate to nearest word

Parameters:

  • len

    The length

#trunc!(len, ellipsis: '...') ⇒ Object

#truncend(len, ellipsis: '...') ⇒ Object

Truncate from middle to end at nearest word

Parameters:

  • len

    The length

#truncend!(len, ellipsis: '...') ⇒ Object

#truncmiddle(len, ellipsis: '...') ⇒ Object

Truncate string in the middle, separating at nearest word

Parameters:

  • len

    The length

  • ellipsis (defaults to: '...')

    The ellipsis

#truncmiddle!(len, ellipsis: '...') ⇒ Object