Class: Pennyworth::Loaders::Gem

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

Overview

Loads an array gems from the RubyGems API.

Instance Method Summary collapse

Instance Method Details

#call(endpoint) ⇒ Object



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

def call endpoint
  http.get("#{configuration.ruby_gems_api_url}/#{endpoint}")
      .then do |response|
        return JSON response.body.to_s, symbolize_names: true if response.status.success?

        Core::EMPTY_HASH
      end
end