Class: Pennyworth::Loaders::HTTPStatus
- Inherits:
-
Object
- Object
- Pennyworth::Loaders::HTTPStatus
- Defined in:
- lib/pennyworth/loaders/http_status.rb
Overview
Loads an array of HTTP status records.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(codes: Rack::Utils::HTTP_STATUS_CODES, model: Models::HTTPStatus) ⇒ HTTPStatus
constructor
A new instance of HTTPStatus.
Constructor Details
#initialize(codes: Rack::Utils::HTTP_STATUS_CODES, model: Models::HTTPStatus) ⇒ HTTPStatus
Returns a new instance of HTTPStatus.
11 12 13 14 15 |
# File 'lib/pennyworth/loaders/http_status.rb', line 11 def initialize(codes: Rack::Utils::HTTP_STATUS_CODES, model: Models::HTTPStatus, **) super(**) @codes = codes @model = model end |
Instance Method Details
#call ⇒ Object
17 18 19 |
# File 'lib/pennyworth/loaders/http_status.rb', line 17 def call(*) codes.map { |(code, label)| model[code:, label:, url: "#{url}/#{code}"] } end |