Class: CommandBus

Inherits:
Object
  • Object
show all
Defined in:
lib/command_bus.rb,
lib/command_bus/version.rb

Defined Under Namespace

Classes: CommandBusConfig

Constant Summary collapse

Version =
'0.1.0'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.config {|c| ... } ⇒ Object

Yields:

  • (c)


7
8
9
10
11
# File 'lib/command_bus.rb', line 7

def config
    c = CommandBusConfig.new
    yield c
    self.new c
end

Instance Method Details

#execute(cmd) ⇒ Object



18
19
20
21
# File 'lib/command_bus.rb', line 18

def execute(cmd)
    handler_class = load_handler(cmd)
    handler_class.new.execute
end

#rootObject



14
15
16
# File 'lib/command_bus.rb', line 14

def root
    @config.root
end