Class: Transpec::CLI::OptionParser
- Inherits:
-
Object
- Object
- Transpec::CLI::OptionParser
- Defined in:
- lib/transpec/cli/option_parser.rb
Overview
rubocop:disable ClassLength
Constant Summary collapse
- VALID_BOOLEAN_MATCHER_TYPES =
%w(truthy,falsey truthy,falsy true,false)
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize(config = Config.new) ⇒ OptionParser
constructor
A new instance of OptionParser.
- #parse(args) ⇒ Object
Constructor Details
#initialize(config = Config.new) ⇒ OptionParser
Returns a new instance of OptionParser.
17 18 19 20 |
# File 'lib/transpec/cli/option_parser.rb', line 17 def initialize(config = Config.new) @config = config setup_parser end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
15 16 17 |
# File 'lib/transpec/cli/option_parser.rb', line 15 def config @config end |
Instance Method Details
#help ⇒ Object
28 29 30 |
# File 'lib/transpec/cli/option_parser.rb', line 28 def help @parser.help end |
#parse(args) ⇒ Object
22 23 24 25 26 |
# File 'lib/transpec/cli/option_parser.rb', line 22 def parse(args) args = (args) @parser.parse!(args) args end |