Module: Legion::Extensions::Helpers::Transport

Includes:
Base
Included in:
Actors::Subscription, Core, Transport
Defined in:
lib/legion/extensions/helpers/transport.rb

Instance Method Summary collapse

Methods included from Base

#actor_class, #actor_const, #actor_name, #calling_class, #calling_class_array, #from_json, #full_path, #lex_class, #lex_const, #lex_name, #normalize, #runner_class, #runner_const, #runner_name, #to_dotted_hash

Instance Method Details

#build_default_exchangeObject



33
34
35
36
37
38
39
40
# File 'lib/legion/extensions/helpers/transport.rb', line 33

def build_default_exchange
  exchange = "#{transport_class}::Exchanges::#{lex_const}"
  return Object.const_get(exchange) if transport_class::Exchanges.const_defined? lex_const

  transport_class::Exchanges.const_set(lex_const, Class.new(Legion::Transport::Exchange))
  @default_exchange = Kernel.const_get(exchange)
  @default_exchange
end

#default_exchangeObject



29
30
31
# File 'lib/legion/extensions/helpers/transport.rb', line 29

def default_exchange
  @default_exchange ||= build_default_exchange
end

#exchangesObject



25
26
27
# File 'lib/legion/extensions/helpers/transport.rb', line 25

def exchanges
  @exchanges ||= transport_class::Exchanges
end

#messagesObject



17
18
19
# File 'lib/legion/extensions/helpers/transport.rb', line 17

def messages
  @messages ||= transport_class::Messages
end

#queuesObject



21
22
23
# File 'lib/legion/extensions/helpers/transport.rb', line 21

def queues
  @queues ||= transport_class::Queues
end

#transport_classObject



13
14
15
# File 'lib/legion/extensions/helpers/transport.rb', line 13

def transport_class
  @transport_class ||= lex_class::Transport
end

#transport_pathObject



9
10
11
# File 'lib/legion/extensions/helpers/transport.rb', line 9

def transport_path
  @transport_path ||= "#{full_path}/transport"
end