Sha256: 206604536a3d1e518c56bcb67e13922db7fa8b915bbdc847fa1e7fe70bdc1ae5
Contents?: true
Size: 569 Bytes
Versions: 7
Compression:
Stored size: 569 Bytes
Contents
# frozen_string_literal: true require "core" module Pennyworth module Loaders # Loads an array gems from the Standard Gems API. class StandardGem include Import[:configuration, :http] def call endpoint http.get("#{configuration.standard_gems_api_url}/#{endpoint}") .then do |response| response.status.success? ? records(response.body.to_s) : Core::EMPTY_HASH end end private def records(body) = JSON(body, symbolize_names: true).fetch :gems, Core::EMPTY_ARRAY end end end
Version data entries
7 entries across 7 versions & 1 rubygems