Class: PgEventstore::CLI::Parsers::BaseParser
- Inherits:
-
Object
- Object
- PgEventstore::CLI::Parsers::BaseParser
- Defined in:
- lib/pg_eventstore/cli/parsers/base_parser.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args, options) ⇒ BaseParser
constructor
A new instance of BaseParser.
-
#parse ⇒ Array<Array<String>, PgEventstore::CLI::ParserOptions::BaseOptions>
List of commands and parsed options.
Constructor Details
#initialize(args, options) ⇒ BaseParser
Returns a new instance of BaseParser.
18 19 20 21 22 |
# File 'lib/pg_eventstore/cli/parsers/base_parser.rb', line 18 def initialize(args, ) @args = args @options = @parser = ::OptionParser.new(self.class.) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
14 15 16 |
# File 'lib/pg_eventstore/cli/parsers/base_parser.rb', line 14 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/pg_eventstore/cli/parsers/base_parser.rb', line 14 def @options end |
Class Method Details
.banner ⇒ String
9 10 11 |
# File 'lib/pg_eventstore/cli/parsers/base_parser.rb', line 9 def raise NotImplementedError end |
Instance Method Details
#parse ⇒ Array<Array<String>, PgEventstore::CLI::ParserOptions::BaseOptions>
Returns list of commands and parsed options.
26 27 28 29 |
# File 'lib/pg_eventstore/cli/parsers/base_parser.rb', line 26 def parse @options.attach_parser_handlers(@parser) [@parser.parse(args), @options] end |