Class: Slk::Commands::Base
- Inherits:
-
Object
- Object
- Slk::Commands::Base
- Defined in:
- lib/slk/commands/base.rb
Overview
Base class for all CLI commands with option parsing and output helpers rubocop:disable Metrics/ClassLength
Direct Known Subclasses
Activity, Cache, Catchup, Config, Dnd, Emoji, Help, Later, Messages, Presence, Preset, Search, Status, Unread, Workspaces
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.
10 11 12 13 14 |
# File 'lib/slk/commands/base.rb', line 10 def initialize(args, runner:) @runner = runner @options = @positional_args = (args) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/slk/commands/base.rb', line 8 def @options end |
#positional_args ⇒ Object (readonly)
Returns the value of attribute positional_args.
8 9 10 |
# File 'lib/slk/commands/base.rb', line 8 def positional_args @positional_args end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
8 9 10 |
# File 'lib/slk/commands/base.rb', line 8 def runner @runner end |
Instance Method Details
#execute ⇒ Object
16 17 18 |
# File 'lib/slk/commands/base.rb', line 16 def execute raise NotImplementedError, 'Subclass must implement #execute' end |