Sha256: 3618ed11d249379f9a8f65b75399eda16db3fb91d6f080a25d8bf1222c560cef
Contents?: true
Size: 428 Bytes
Versions: 10
Compression:
Stored size: 428 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[:settings].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
10 entries across 10 versions & 1 rubygems