Class: Pennyworth::CLI::Actions::StandardGem

Inherits:
Sod::Action
  • Object
show all
Defined in:
lib/pennyworth/cli/actions/standard_gem.rb

Overview

Handles the Standard Gem action.

Constant Summary collapse

ENDPOINTS =
{
  "all" => "stdgems.json",
  "default" => "default_gems.json",
  "bundled" => "bundled_gems.json"
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(processor: Processor.for_standard_gems, endpoints: ENDPOINTS) ⇒ StandardGem

Returns a new instance of StandardGem.



22
23
24
25
26
# File 'lib/pennyworth/cli/actions/standard_gem.rb', line 22

def initialize(processor: Processor.for_standard_gems, endpoints: ENDPOINTS, **)
  super(**)
  @processor = processor
  @endpoints = endpoints
end

Instance Method Details

#call(kind = default) ⇒ Object



28
# File 'lib/pennyworth/cli/actions/standard_gem.rb', line 28

def call(kind = default) = io.puts processor.call(endpoints.fetch(kind)).to_json