Sha256: 71503bece5eb011f5e42f9936aeb0fcb16500d171ec1eeaf8a90e4c884e18166

Contents?: true

Size: 504 Bytes

Versions: 46

Compression:

Stored size: 504 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

46 entries across 46 versions & 1 rubygems

Version Path
pub_sub_model_sync-1.9.3 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.9.2 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.9.1 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.9.0 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.7.2 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.7.1 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.7.0 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.6.4 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.6.3 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.6.2 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.6.1 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.6.1pre lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.6.0 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.5.1pre lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.5.0 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.4.0 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.3.1 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.3.0 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.2.1 lib/pub_sub_model_sync/connector.rb
pub_sub_model_sync-1.2.0 lib/pub_sub_model_sync/connector.rb