Class: Texas::OptionParser
- Inherits:
-
Object
- Object
- Texas::OptionParser
- Includes:
- OutputHelper
- Defined in:
- lib/texas/option_parser.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(args) ⇒ OptionParser
constructor
A new instance of OptionParser.
-
#parse ⇒ Object
Returns a structure describing the options.
Methods included from OutputHelper
Constructor Details
#initialize(args) ⇒ OptionParser
Returns a new instance of OptionParser.
11 12 13 14 |
# File 'lib/texas/option_parser.rb', line 11 def initialize(args) @args = args @options = OpenStruct.new end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
9 10 11 |
# File 'lib/texas/option_parser.rb', line 9 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/texas/option_parser.rb', line 9 def @options end |
Instance Method Details
#parse ⇒ Object
Returns a structure describing the options.
18 19 20 21 22 23 24 25 |
# File 'lib/texas/option_parser.rb', line 18 def parse lookup_and_execute_require_option(args) set_contents_template_from_args unless args.empty? check_mandatory! if .check_mandatory_arguments end |