Sha256: 14dcefae48312c9ce8072491520f39736dd00361526929bebc8e244ad753790d

Contents?: true

Size: 281 Bytes

Versions: 1

Compression:

Stored size: 281 Bytes

Contents

class String
  def truncate(width)
    self[0, width]
  end

  def convert_entities
    self.gsub(/&gt;/, '>').gsub(/&lt;/, '<')
  end

  def pluralize(n, suffix = 's', singular_suffix = '')
    if n == 1
      self + singular_suffix
    else
      self + suffix
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
usaidwat-0.1.7 lib/usaidwat/ext/string.rb