Sha256: a8e264706f91a4eba6b68aa0bdb78ec6b91bf359eed1aab51a3143c3835749b5

Contents?: true

Size: 718 Bytes

Versions: 4

Compression:

Stored size: 718 Bytes

Contents

# frozen_string_literal: true

module PubSubModelSync
  class Config
    cattr_accessor(:subscribers) { [] }
    cattr_accessor(:publishers) { [] }
    cattr_accessor(:service_name) { :google }
    cattr_accessor :logger

    # google service
    cattr_accessor :project, :credentials, :topic_name, :subscription_name

    # rabbitmq service
    cattr_accessor :bunny_connection, :queue_name, :topic_name

    # kafka service
    cattr_accessor :kafka_connection, :topic_name

    def self.log(msg, kind = :info)
      msg = "PS_MSYNC ==> #{msg}"
      if logger == :raise_error
        kind == :error ? raise(msg) : puts(msg)
      else
        logger ? logger.send(kind, msg) : puts(msg)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pub_sub_model_sync-0.4.2.1 lib/pub_sub_model_sync/config.rb
pub_sub_model_sync-0.4.2 lib/pub_sub_model_sync/config.rb
pub_sub_model_sync-0.4.1 lib/pub_sub_model_sync/config.rb
pub_sub_model_sync-0.4.0 lib/pub_sub_model_sync/config.rb