Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/svg_conform/compatibility/report_formatter.rb

Overview

String extension for truncation

Instance Method Summary collapse

Instance Method Details

#truncate(length) ⇒ Object



352
353
354
355
356
357
358
# File 'lib/svg_conform/compatibility/report_formatter.rb', line 352

def truncate(length)
  if self.length > length
    "#{self[0..length - 4]}..."
  else
    self
  end
end