Sha256: 7148a5996d865d12e05200111e2903a20f59afb189c69bc71fa722a83eb448f5
Contents?: true
Size: 630 Bytes
Versions: 11
Compression:
Stored size: 630 Bytes
Contents
# frozen_string_literal: true module Realize class Value # This transformer can take in a hash of: "value" -> "new value". It's basically a # simple way for doing simple if X = Y, then Z replacements. # This can be extended to include and customize case and type sensitivies, but right now # it is type and case-sensitive so be careful! class Map acts_as_hashable attr_reader :values def initialize(values: {}) @values = values || {} freeze end def transform(_resolver, value, _time, _record) values.fetch(value, value) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems