Class: ArgsParser::Args
- Inherits:
-
Object
- Object
- ArgsParser::Args
- Defined in:
- lib/argsparser/args.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#switches ⇒ Object
readonly
Returns the value of attribute switches.
Instance Method Summary collapse
-
#initialize(options: {}, switches: {}) ⇒ Args
constructor
A new instance of Args.
Constructor Details
#initialize(options: {}, switches: {}) ⇒ Args
Returns a new instance of Args.
3 4 5 6 7 8 9 10 11 |
# File 'lib/argsparser/args.rb', line 3 def initialize(options: {}, switches: {}) args = ARGV x = Parser.parse args, , switches @switches = Switches.new(x[1]) @options = Options.new(x[0]) @data = x[2] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
13 14 15 |
# File 'lib/argsparser/args.rb', line 13 def data @data end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/argsparser/args.rb', line 13 def @options end |
#switches ⇒ Object (readonly)
Returns the value of attribute switches.
13 14 15 |
# File 'lib/argsparser/args.rb', line 13 def switches @switches end |