Class: Cumuli::CLI::Args
- Inherits:
-
Object
- Object
- Cumuli::CLI::Args
- Defined in:
- lib/cumuli/cli/args.rb
Instance Attribute Summary collapse
-
#argv ⇒ Object
readonly
Returns the value of attribute argv.
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
Instance Method Summary collapse
- #foreman_options ⇒ Object
-
#initialize(argv) ⇒ Args
constructor
A new instance of Args.
- #name ⇒ Object
Constructor Details
#initialize(argv) ⇒ Args
Returns a new instance of Args.
6 7 8 9 |
# File 'lib/cumuli/cli/args.rb', line 6 def initialize(argv) @argv = argv @dir ||= argv.shift end |
Instance Attribute Details
#argv ⇒ Object (readonly)
Returns the value of attribute argv.
4 5 6 |
# File 'lib/cumuli/cli/args.rb', line 4 def argv @argv end |
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
4 5 6 |
# File 'lib/cumuli/cli/args.rb', line 4 def dir @dir end |
Instance Method Details
#foreman_options ⇒ Object
15 16 17 |
# File 'lib/cumuli/cli/args.rb', line 15 def argv.join(' ') end |
#name ⇒ Object
11 12 13 |
# File 'lib/cumuli/cli/args.rb', line 11 def name @name ||= dir.match(/([a-z_]+)$/i)[0] end |