Class: Ark::CLI::Report
- Inherits:
-
Object
- Object
- Ark::CLI::Report
- Defined in:
- lib/ark/cli/report.rb
Overview
Stores information parsed from the command line for later inspection
Instance Method Summary collapse
-
#arg(name) ⇒ Object
Get an argument by
name
. -
#args ⇒ Object
Return an array of all args parsed.
-
#count(name) ⇒ Object
Get the toggle count for an option by
name
. -
#initialize(args, named, trailing, options, counts) ⇒ Report
constructor
Initialize a bare
Report
object. -
#opt(name) ⇒ Object
Get the value of an option by
name
. -
#opts ⇒ Object
Get a hash of all options and their values.
-
#trailing ⇒ Object
Return an array of any arguments without names.
Constructor Details
#initialize(args, named, trailing, options, counts) ⇒ Report
Initialize a bare Report
object
7 8 9 10 11 12 13 |
# File 'lib/ark/cli/report.rb', line 7 def initialize(args, named, trailing, , counts) @args = args @named = named @trailing = trailing @options = @counts = counts end |
Instance Method Details
#arg(name) ⇒ Object
Get an argument by name
21 22 23 |
# File 'lib/ark/cli/report.rb', line 21 def arg(name) return @named[name.to_s] end |
#args ⇒ Object
Return an array of all args parsed
16 17 18 |
# File 'lib/ark/cli/report.rb', line 16 def args return @args end |
#count(name) ⇒ Object
Get the toggle count for an option by name
41 42 43 |
# File 'lib/ark/cli/report.rb', line 41 def count(name) return @counts[name.to_s] end |
#opt(name) ⇒ Object
Get the value of an option by name
36 37 38 |
# File 'lib/ark/cli/report.rb', line 36 def opt(name) return @options[name.to_s] end |
#opts ⇒ Object
Get a hash of all options and their values
31 32 33 |
# File 'lib/ark/cli/report.rb', line 31 def opts return @options end |
#trailing ⇒ Object
Return an array of any arguments without names
26 27 28 |
# File 'lib/ark/cli/report.rb', line 26 def trailing return @trailing end |