Sha256: 6b5a7d560d8e6ce73685d1b5e22fe7015b8a5f17439028ddc18acf151f6f58f4

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

require_relative 'base'

module Legion
  module Extensions
    module Helpers
      module Transport
        include Legion::Extensions::Helpers::Base

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

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

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

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

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

        def default_exchange
          @default_exchange ||= build_default_exchange
        end

        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)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
legionio-0.3.0 lib/legion/extensions/helpers/transport.rb