Class: Teems::Commands::Base
- Inherits:
-
Object
- Object
- Teems::Commands::Base
- Includes:
- CommandOutput, CommandValidation
- Defined in:
- lib/teems/commands/base.rb
Overview
Base class for all CLI commands with option parsing and output helpers
Direct Known Subclasses
Activity, Auth, Cal, Channels, Chats, Help, Meeting, Messages, Ooo, Org, Status, Sync, Who
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#positional_args ⇒ Object
readonly
Returns the value of attribute positional_args.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(args, runner:) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(args, runner:) ⇒ Base
Returns a new instance of Base.
54 55 56 57 58 59 60 |
# File 'lib/teems/commands/base.rb', line 54 def initialize(args, runner:) @runner = runner @options = @unknown_options = [] @positional_args = [] (args) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
52 53 54 |
# File 'lib/teems/commands/base.rb', line 52 def @options end |
#positional_args ⇒ Object (readonly)
Returns the value of attribute positional_args.
52 53 54 |
# File 'lib/teems/commands/base.rb', line 52 def positional_args @positional_args end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
52 53 54 |
# File 'lib/teems/commands/base.rb', line 52 def runner @runner end |
Instance Method Details
#execute ⇒ Object
62 63 64 |
# File 'lib/teems/commands/base.rb', line 62 def execute raise NotImplementedError, 'Subclass must implement #execute' end |