Sha256: 64042e9961f19a687db16ef09246ebe7e48c1b15df01fd5ab7931655f727c7bc
Contents?: true
Size: 558 Bytes
Versions: 16
Compression:
Stored size: 558 Bytes
Contents
class String # TODO: replace with better implementations # NOTE: strings are currently immutable in Opal, so no ! methods def camelize self.split("_").map {|s| s.capitalize }.join("") end def underscore self.scan(/[A-Z][a-z]*/).join("_").downcase end def pluralize # TODO: Temp implementation if self[-1] != 's' return self + 's' else return self end end def singularize # TODO: Temp implementation if self[-1] == 's' return self[0..-2] else return self end end end
Version data entries
16 entries across 16 versions & 1 rubygems