Sha256: 67e65f5e79b60f44dfd8fd28267e5a96fa7e2416acee83f9d81ef6f249b640c5
Contents?: true
Size: 434 Bytes
Versions: 24
Compression:
Stored size: 434 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(Configuration::Loader.call.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
24 entries across 24 versions & 1 rubygems
Version | Path |
---|---|
pennyworth-12.1.0 | lib/pennyworth/inflector.rb |
pennyworth-12.0.2 | lib/pennyworth/inflector.rb |
pennyworth-12.0.1 | lib/pennyworth/inflector.rb |
pennyworth-12.0.0 | lib/pennyworth/inflector.rb |