class String

Public Instance Methods

shorten(length = 10, ellipsis = '...') click to toggle source
# File lib/ohgiri.rb, line 2
def shorten(length = 10, ellipsis = '...')
  self.size > length ? "#{self[0, (length - ellipsis.length)]}#{ellipsis}" : self
end