Class: Lapidarius::CLI

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

Constant Summary collapse

HELP_FLAGS =
%w[-h --help]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args: [], io: STDOUT, command: Command, cutter: Cutter, tree: Tree) ⇒ CLI

Returns a new instance of CLI.



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

def initialize(args: [], io: STDOUT, command: Command, cutter: Cutter, tree: Tree)
  @args = args
  @io = io
  @command = command
  @cutter = cutter
  @tree = tree
  @name = @args.shift unless help?
  parser.parse!(@args)
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

#remoteObject (readonly)

Returns the value of attribute remote.



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

def remote
  @remote
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



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

def call
  @io.puts out
end