Sha256: 7d6af0dec441c6646b9a7cc43a3a5ffb4a45996e304b591647e222d2df2aff1e
Contents?: true
Size: 433 Bytes
Versions: 17
Compression:
Stored size: 433 Bytes
Contents
# frozen_string_literal: true module Pennyworth # Overrides any string to desired form if matched, otherwise answers the original string. class Inflector DEFAULTS = Array(Container[:configuration].inflections).reduce({}, :merge) def initialize overrides = DEFAULTS @overrides = overrides end def call(key) = overrides.fetch(key) { |fallback| fallback } private attr_reader :overrides end end
Version data entries
17 entries across 17 versions & 1 rubygems