Module: ActiveEvent::Domain

Extended by:
ActiveSupport::Concern
Defined in:
lib/active_event/domain.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#initialize(*args) ⇒ Object



20
21
22
23
24
# File 'lib/active_event/domain.rb', line 20

def initialize(*args)
  super
  # DRb.start_service # should not be necessary
  self.server = DRbObject.new_with_uri self.class.server_uri
end

#run_command(command) ⇒ Object



26
27
28
29
30
31
# File 'lib/active_event/domain.rb', line 26

def run_command(command)
  command.valid? && server.run_command(command)
rescue DomainExceptionCapture => e
  message, backtrace = JSON.parse(e.message)
  raise DomainException, message, backtrace
end