Module: Moleculer::Service

Defined in:
lib/moleculer/service/remote.rb,
lib/moleculer/service/base.rb,
lib/moleculer/service/event.rb,
lib/moleculer/service/action.rb

Defined Under Namespace

Classes: Action, Base, Event, Remote

Class Method Summary collapse

Class Method Details

.from_remote_info(service_info, service_node) ⇒ Object

Creates a service instance from remote service info

Parameters:

  • service_info (Hash)

    remote service information



9
10
11
12
13
14
15
16
# File 'lib/moleculer/service/remote.rb', line 9

def self.from_remote_info(service_info, service_node)
  Class.new(Remote) do
    service_name Support::HashUtil.fetch(service_info, :name)
    fetch_actions(service_info)
    fetch_events(service_info)
    node service_node
  end
end