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, Topics::Pause, Topics::Resume
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.
47 48 49 |
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 47 def initialize(command) @command = command end |
Class Attribute Details
.name ⇒ Object
Returns the value of attribute name.
39 40 41 |
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 39 def name @name end |
Instance Attribute Details
#command ⇒ Hash (readonly)
43 44 45 |
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 43 def command @command end |
Instance Method Details
#call ⇒ Object
Executes the command after receiving it.
52 53 54 |
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 52 def call raise NotImlementedError, "Please implement in a subclass" end |