Sha256: 72804cac324b1e1bd6ed08809a5b203baa0b53dab527fa466ca4e26cbb12209c
Contents?: true
Size: 468 Bytes
Versions: 12
Compression:
Stored size: 468 Bytes
Contents
# frozen_string_literal: true module PageMagic module Utils # module String - contains methods for manipulating strings module String class << self # convert a snake case `String` or `Symbol` # @example # classify(:snake_case) # => "SnakeCase" # @return [String] def classify(string_or_symbol) string_or_symbol.to_s.split('_').collect(&:capitalize).reduce(:+) end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems