Sha256: 196982ed8c3e919efada5edb1dcca0532c00a6368bb5d5f3aba403760b0fcc69

Contents?: true

Size: 434 Bytes

Versions: 18

Compression:

Stored size: 434 Bytes

Contents

# frozen_string_literal: true

require "core"
require "ghub"

module Pennyworth
  module Loaders
    # Loads an array projects from the GitHub API.
    class GitHub
      def initialize endpoint: Ghub::Endpoints::Repositories::Root.new
        @endpoint = endpoint
      end

      def call(path) = endpoint.index(*path.split("/")).value_or(Core::EMPTY_ARRAY).map(&:to_h)

      private

      attr_reader :endpoint
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
pennyworth-18.0.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-17.8.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-17.7.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-17.6.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-17.5.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-17.4.1 lib/pennyworth/loaders/git_hub.rb
pennyworth-17.4.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-17.3.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-17.2.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-17.1.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-17.0.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-16.7.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-16.5.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-16.4.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-16.3.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-16.2.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-16.1.0 lib/pennyworth/loaders/git_hub.rb
pennyworth-16.0.0 lib/pennyworth/loaders/git_hub.rb