Module: Smplkit::Jobs::HttpMethod
- Defined in:
- lib/smplkit/jobs/models.rb
Overview
HTTP verb a job uses when it fires (ADR-049).
Mirrors the jobs spec’s method enum so a job’s configuration.method field is constrained to a known value instead of accepting any string. Members are declared in alphabetical order.
Constant Summary collapse
- DELETE =
"DELETE"- GET =
"GET"- PATCH =
"PATCH"- POST =
"POST"- PUT =
"PUT"- VALUES =
[DELETE, GET, PATCH, POST, PUT].freeze
Class Method Summary collapse
-
.coerce(value) ⇒ String?
Validate and normalize an input to a wire-format string.
Class Method Details
.coerce(value) ⇒ String?
Validate and normalize an input to a wire-format string.
51 52 53 54 55 56 57 58 59 |
# File 'lib/smplkit/jobs/models.rb', line 51 def self.coerce(value) return nil if value.nil? s = value.to_s return s if VALUES.include?(s) raise ArgumentError, "Unknown HttpMethod #{value.inspect}; expected one of #{VALUES.inspect}" end |