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