Sha256: c097ca67d22f588b818a01dd385dbc0f3ae2a1ba26cccf348490dff0031b7c01

Contents?: true

Size: 731 Bytes

Versions: 3

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true

module PubSubModelSync
  class Config
    cattr_accessor :listeners, default: []
    cattr_accessor :publishers, default: []
    cattr_accessor :service_name, default: :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

3 entries across 3 versions & 1 rubygems

Version Path
pub_sub_model_sync-0.2.1 lib/pub_sub_model_sync/config.rb
pub_sub_model_sync-0.2.0 lib/pub_sub_model_sync/config.rb
pub_sub_model_sync-0.1.5 lib/pub_sub_model_sync/config.rb