Class: Pennyworth::CLI::Actions::Gem

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

Overview

Handles the RubyGem action.

Instance Method Summary collapse

Constructor Details

#initialize(processor: Processor.for_gems) ⇒ Gem

Returns a new instance of Gem.



18
19
20
21
# File 'lib/pennyworth/cli/actions/gem.rb', line 18

def initialize(processor: Processor.for_gems, **)
  super(**)
  @processor = processor
end

Instance Method Details

#call(handle = nil) ⇒ Object



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

def call handle = nil
  endpoint = "owners/#{handle || default}/gems.json"
  kernel.puts processor.call(endpoint).to_json
end