Sha256: 33bed53c00ea7520bdf6589f9b15b46d6eddae7f782a27d3d453d311a65a3eb0
Contents?: true
Size: 446 Bytes
Versions: 10
Compression:
Stored size: 446 Bytes
Contents
# frozen_string_literal: true module ActionPolicy module Ext # Add `classify` to Symbol module SymbolClassify refine Symbol do if "".respond_to?(:classify) def classify to_s.classify end else def classify word = to_s.capitalize word.gsub!(/(?:_)([a-z\d]*)/) { $1.capitalize } word end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems