Class: Lapidarius::CLI
- Inherits:
-
Object
- Object
- Lapidarius::CLI
- Defined in:
- lib/lapidarius/cli.rb
Constant Summary collapse
- HELP_FLAGS =
%w[-h --help]- COL_WIDTH =
23
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(input, out = STDOUT, command = Command, cutter = Cutter, tree = Tree) ⇒ CLI
constructor
A new instance of CLI.
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/lapidarius/cli.rb', line 8 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
8 9 10 |
# File 'lib/lapidarius/cli.rb', line 8 def version @version end |
Instance Method Details
#call ⇒ Object
21 22 23 |
# File 'lib/lapidarius/cli.rb', line 21 def call @out.puts output end |