Class: Karafka::Web::Pro::Commanding::Commands::Base
- Inherits:
-
Object
- Object
- Karafka::Web::Pro::Commanding::Commands::Base
- Defined in:
- lib/karafka/web/pro/commanding/commands/base.rb
Overview
Base for all the commands
Direct Known Subclasses
Consumers::Quiet, Consumers::Stop, Consumers::Trace, Partitions::Pause, Partitions::Resume, Partitions::Seek
Class Attribute Summary collapse
-
.name ⇒ Object
Returns the value of attribute name.
Instance Attribute Summary collapse
- #command ⇒ Hash readonly
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command after receiving it.
-
#initialize(command) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(command) ⇒ Base
Returns a new instance of Base.
23 24 25 |
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 23 def initialize(command) @command = command end |
Class Attribute Details
.name ⇒ Object
Returns the value of attribute name.
15 16 17 |
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 15 def name @name end |
Instance Attribute Details
#command ⇒ Hash (readonly)
19 20 21 |
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 19 def command @command end |
Instance Method Details
#call ⇒ Object
Executes the command after receiving it.
28 29 30 |
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 28 def call raise NotImlementedError, 'Please implement in a subclass' end |