Class: Lapidarius::CLI

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

Constant Summary collapse

HELP_FLAGS =
%w[-h --help]
COL_WIDTH =
23

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, out = STDOUT, command = Command, cutter = Cutter, tree = Tree) ⇒ CLI

Returns a new instance of CLI.



10
11
12
13
14
15
16
17
18
19
# File 'lib/lapidarius/cli.rb', line 10

def initialize(input, 
               out = STDOUT, 
               command = Command,
               cutter = Cutter,
               tree = Tree)
  @name, @version = Array(input).map(&:strip)
  @out = out
  @cutter = cutter.new(name: @name, cmd_klass: command, version: @version)
  @tree = tree
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



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

def version
  @version
end

Instance Method Details

#callObject



21
22
23
# File 'lib/lapidarius/cli.rb', line 21

def call
  @out.puts output
end