Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/kdeploy/cli.rb
Overview
Add String truncate method if not available
Instance Method Summary collapse
Instance Method Details
#truncate(length) ⇒ Object
5 6 7 8 9 |
# File 'lib/kdeploy/cli.rb', line 5 def truncate(length) return self if size <= length "#{self[0, length - 3]}..." end |