Sha256: a5bf6a5723b15fe9b825c7284a9a54d7244aec7238f499ae9591044e59804ef9
Contents?: true
Size: 634 Bytes
Versions: 21
Compression:
Stored size: 634 Bytes
Contents
require 'volt/extra_core/inflector' 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 dasherize self.gsub('_', '-') end def pluralize Inflector.pluralize(self) end def singularize Inflector.singularize(self) end def plural? # TODO: Temp implementation self.pluralize == self end def singular? # TODO: Temp implementation self.singularize == self end end
Version data entries
21 entries across 21 versions & 1 rubygems