Class: CLI::Shell
- Inherits:
-
Object
- Object
- CLI::Shell
- Defined in:
- lib/cli/shell.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
Returns the value of attribute path.
-
#session ⇒ Object
Returns the value of attribute session.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(cmd) ⇒ Shell
constructor
A new instance of Shell.
- #print_help ⇒ Object
Constructor Details
#initialize(cmd) ⇒ Shell
Returns a new instance of Shell.
13 14 15 16 17 18 19 20 21 |
# File 'lib/cli/shell.rb', line 13 def initialize(cmd) cmd_shell = Psych.load_file(File.join(__dir__, 'help.yml'))[cmd] @usage = ["Usage: #{cmd_shell['usage']}\n"] @options = nil @usage << (cmd_shell['options']) @path = Dir.pwd @target = target_directory @path @session = false end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/cli/shell.rb', line 11 def @options end |
#path ⇒ Object
Returns the value of attribute path.
10 11 12 |
# File 'lib/cli/shell.rb', line 10 def path @path end |
#session ⇒ Object
Returns the value of attribute session.
10 11 12 |
# File 'lib/cli/shell.rb', line 10 def session @session end |
#target ⇒ Object
Returns the value of attribute target.
11 12 13 |
# File 'lib/cli/shell.rb', line 11 def target @target end |
Instance Method Details
#print_help ⇒ Object
23 24 25 |
# File 'lib/cli/shell.rb', line 23 def print_help puts @usage end |