Sha256: b8f1ff2b867bbd37229b9894aed9e805071e0368b161974e74fc6f1bd9148769
Contents?: true
Size: 315 Bytes
Versions: 35
Compression:
Stored size: 315 Bytes
Contents
# frozen_string_literal: true module Groundskeeper # Helpers for strings. module StringUtils def self.underscore(word) return "" unless word.respond_to?(:gsub) word .gsub(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2') .downcase end end end
Version data entries
35 entries across 35 versions & 1 rubygems