Class: Pennyworth::Loaders::StandardGem

Inherits:
Object
  • Object
show all
Defined in:
lib/pennyworth/loaders/standard_gem.rb

Overview

Loads an array gems from the Standard Gems API.

Instance Method Summary collapse

Instance Method Details

#call(endpoint) ⇒ Object



11
12
13
14
15
16
# File 'lib/pennyworth/loaders/standard_gem.rb', line 11

def call endpoint
  http.get("#{settings.standard_gems_api_url}/#{endpoint}")
      .then do |response|
        response.status.success? ? records(response.body.to_s) : Core::EMPTY_HASH
      end
end