Class: Pennyworth::CLI::Parsers::GitHub

Inherits:
Object
  • Object
show all
Defined in:
lib/pennyworth/cli/parsers/git_hub.rb

Overview

Handles parsing of Command Line Interface (CLI) GitHub options.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration = Configuration::Loader.call, client: CLIENT) ⇒ GitHub

Returns a new instance of GitHub.



14
15
16
17
# File 'lib/pennyworth/cli/parsers/git_hub.rb', line 14

def initialize configuration = Configuration::Loader.call, client: CLIENT
  @configuration = configuration
  @client = client
end

Class Method Details

.callObject



12
# File 'lib/pennyworth/cli/parsers/git_hub.rb', line 12

def self.call(...) = new(...).call

Instance Method Details

#call(arguments = []) ⇒ Object



19
20
21
22
23
# File 'lib/pennyworth/cli/parsers/git_hub.rb', line 19

def call arguments = []
  client.separator "\nGITHUB OPTIONS:\n"
  private_methods.sort.grep(/add_/).each { |method| __send__ method }
  arguments.empty? ? arguments : client.parse!(arguments)
end