Sha256: 5e84027ff475b66a45d3de6f05ed3e78b73f7d0c96efed6f9aec1dcaa5417bc3
Contents?: true
Size: 478 Bytes
Versions: 12
Compression:
Stored size: 478 Bytes
Contents
# frozen_string_literal: true module Dopstick module Refinements refine String do def presence empty? ? nil : self end def camelize split("-") .map {|word| word.split("_").map(&:capitalize).join } .join("::") end def underscore(separator = "/") split("::") .map {|word| word.gsub(/([A-Z]+)/m, "_\\1")[1..-1] } .join(separator) .downcase end end end end
Version data entries
12 entries across 12 versions & 1 rubygems