Module: Smplkit::Audit::TransformType

Defined in:
lib/smplkit/audit/models.rb

Overview

Engine that evaluates a forwarder’s transform template (ADR-047 §2.12). Only JSONATA is supported today; the enum exists so the field is typed instead of accepting any string, and so additional engines can be added without breaking the public surface.

Constant Summary collapse

JSONATA =
"JSONATA"
VALUES =
[JSONATA].freeze

Class Method Summary collapse

Class Method Details

.coerce(value) ⇒ String?

Validate and normalize an input to a wire-format string.

Parameters:

  • value (String, nil)

    a published constant or its literal string.

Returns:

  • (String, nil)

    the canonical wire value (or nil when input is nil).

Raises:

  • (ArgumentError)

    when value is not a member of VALUES.



131
132
133
134
135
136
137
138
139
# File 'lib/smplkit/audit/models.rb', line 131

def self.coerce(value)
  return nil if value.nil?

  s = value.to_s
  return s if VALUES.include?(s)

  raise ArgumentError,
        "Unknown TransformType #{value.inspect}; expected one of #{VALUES.inspect}"
end