Class: Evostream::Commands::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/evostream/event/commands.rb

Overview

Class parent for all command

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commands = {}) ⇒ Command

Returns a new instance of Command.



14
15
16
17
18
19
20
# File 'lib/evostream/event/commands.rb', line 14

def initialize(commands = {})
  @command = []
  commands.each do |command_name, command_param|
    @command.push send(command_name, command_param)
  end
  test_missing_parameter
end

Class Method Details

.descendantsObject



26
27
28
# File 'lib/evostream/event/commands.rb', line 26

def self.descendants
  ObjectSpace.each_object(Class).select { |klass| klass < self }
end

Instance Method Details

#cmdObject



22
23
24
# File 'lib/evostream/event/commands.rb', line 22

def cmd
  Evostream.logger "Command before encode : #{@command}"
end