Sha256: 36bd1eedb09b0c7f15e945074ac25aeb17d137fca885f28d4fea86137c63c777

Contents?: true

Size: 503 Bytes

Versions: 6

Compression:

Stored size: 503 Bytes

Contents

# frozen_string_literal: true

module PubSubModelSync
  class Connector
    attr_accessor :service
    delegate :listen_messages, :publish, :stop, to: :service

    def initialize
      @service = build_service
    end

    private

    def build_service
      case Config.service_name
      when :google
        PubSubModelSync::ServiceGoogle.new
      when :kafka
        PubSubModelSync::ServiceKafka.new
      else # :rabbit_mq
        PubSubModelSync::ServiceRabbit.new
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pub_sub_model_sync-0.4.2.1 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-0.4.2 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-0.4.1 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-0.4.0 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-0.3.1 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-0.3.0 lib/pub_sub_model_sync/connector.rb