Class: Lapidarius::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/lapidarius/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dep_klass: ::Gem::Commands::DependencyCommand, ui_klass: UI) ⇒ Command

Returns a new instance of Command.



8
9
10
11
# File 'lib/lapidarius/command.rb', line 8

def initialize(dep_klass: ::Gem::Commands::DependencyCommand, ui_klass: UI)
  @dep = dep_klass.new
  @dep.ui = ui_klass.new
end

Instance Attribute Details

#depObject (readonly)

Returns the value of attribute dep.



6
7
8
# File 'lib/lapidarius/command.rb', line 6

def dep
  @dep
end

Instance Method Details

#call(*args) ⇒ Object



13
14
15
16
17
# File 'lib/lapidarius/command.rb', line 13

def call(*args)
  @dep.ui.clear!
  @dep.invoke(*options(args))
  @dep.ui.out
end