Class: Karafka::Web::Pro::Commanding::Commands::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/karafka/web/pro/commanding/commands/base.rb

Overview

Base for all the commands

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Base

Returns a new instance of Base.

Parameters:

  • command (Command)

    command details (if any). Some commands may require extra details to work. They can be obtained from here.



47
48
49
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 47

def initialize(command)
  @command = command
end

Class Attribute Details

.nameObject

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

#commandHash (readonly)

Returns:

  • (Hash)


43
44
45
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 43

def command
  @command
end

Instance Method Details

#callObject

Executes the command after receiving it.

Raises:

  • (NotImlementedError)


52
53
54
# File 'lib/karafka/web/pro/commanding/commands/base.rb', line 52

def call
  raise NotImlementedError, "Please implement in a subclass"
end