Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/cvss_suite/extensions/string.rb

Overview

Extension for String class

Instance Method Summary collapse

Instance Method Details

#truncate(truncate_to) ⇒ Object



3
4
5
6
7
# File 'lib/cvss_suite/extensions/string.rb', line 3

def truncate(truncate_to)
  return dup unless length > truncate_to

  (self[0, truncate_to + 1]).to_s
end