Sha256: ca7586d88ae92bad89cce60dd0fc5ef29305b916584b04cd142123551eae7406
Contents?: true
Size: 589 Bytes
Versions: 14
Compression:
Stored size: 589 Bytes
Contents
# frozen_string_literal: true require "rack" module Pennyworth module Loaders # Loads an array of HTTP status records. class HTTPStatuses include Import[:configuration] def initialize(codes: Rack::Utils::HTTP_STATUS_CODES, model: Models::HTTPStatus, **) super(**) @codes = codes @model = model end def call _omit = nil codes.map { |(code, label)| model[code:, label:, url: "#{url}/#{code}"] } end private attr_reader :codes, :model def url = configuration.http_statuses_url end end end
Version data entries
14 entries across 14 versions & 1 rubygems