Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/kindlerb.rb
Overview
monkeypatch
Instance Method Summary collapse
Instance Method Details
#shorten(max) ⇒ Object
14 15 16 |
# File 'lib/kindlerb.rb', line 14 def shorten(max) length > max ? Array(self[0,max].split(/\s+/)[0..-2]).join(' ') + '...' : self end |