Sha256: 560a31220c65b87c4aa928e639b571f5cdf5628da8a5b66b50a88f6f4ead07ff
Contents?: true
Size: 517 Bytes
Versions: 23
Compression:
Stored size: 517 Bytes
Contents
require "active_support/inflector" module StringHelpers def self.underscore_to_classname(underscored_symbol) underscored_symbol.to_s.camelize end def self.classname_to_underscore(classname) classname.underscore end # Lifted from Rails' text helpers. def self.pluralize(count, singular, plural_arg = nil, plural: plural_arg) word = if count == 1 || count =~ /^1(\.0+)?$/ singular else plural || singular.pluralize end "#{count || 0} #{word}" end end
Version data entries
23 entries across 23 versions & 1 rubygems