Class: Pennyworth::Loaders::GitHub
- Inherits:
-
Object
- Object
- Pennyworth::Loaders::GitHub
- Defined in:
- lib/pennyworth/loaders/git_hub.rb
Overview
Loads an array projects from the GitHub API.
Instance Method Summary collapse
- #call(path) ⇒ Object
-
#initialize(endpoint: Ghub::Endpoints::Repositories::Root.new) ⇒ GitHub
constructor
A new instance of GitHub.
Constructor Details
#initialize(endpoint: Ghub::Endpoints::Repositories::Root.new) ⇒ GitHub
Returns a new instance of GitHub.
10 11 12 |
# File 'lib/pennyworth/loaders/git_hub.rb', line 10 def initialize endpoint: Ghub::Endpoints::Repositories::Root.new @endpoint = endpoint end |
Instance Method Details
#call(path) ⇒ Object
14 |
# File 'lib/pennyworth/loaders/git_hub.rb', line 14 def call(path) = endpoint.index(*path.split("/")).value_or(Core::EMPTY_ARRAY).map(&:to_h) |