Class: Outboxable::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/outboxable/configuration.rb

Constant Summary collapse

ALLOWED_MESSAGE_BROKERS =
%i[rabbitmq].freeze
ALLOWED_ORMS =
%i[activerecord mongoid].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.

Raises:



30
31
32
33
34
35
# File 'lib/outboxable/configuration.rb', line 30

def initialize
  raise Error, 'Sidekiq is not available. Unfortunately, sidekiq must be available for Outboxable to work' unless Object.const_defined?('Sidekiq')
  raise Error, 'Outboxable Gem only supports Rails but you application does not seem to be a Rails app' unless Object.const_defined?('Rails')
  raise Error, 'Outboxable Gem only support Rails version 7 and newer' if Rails::VERSION::MAJOR < 7
  raise Error, 'Outboxable Gem uses the sidekiq-cron Gem. Make sure you add it to your project' unless Object.const_defined?('Sidekiq::Cron')
end

Instance Attribute Details

#message_brokerObject

Returns the value of attribute message_broker.



21
22
23
# File 'lib/outboxable/configuration.rb', line 21

def message_broker
  @message_broker
end

#ormObject

Returns the value of attribute orm.



21
22
23
# File 'lib/outboxable/configuration.rb', line 21

def orm
  @orm
end

#rabbitmq_event_bus_exchangeObject

Returns the value of attribute rabbitmq_event_bus_exchange.



21
22
23
# File 'lib/outboxable/configuration.rb', line 21

def rabbitmq_event_bus_exchange
  @rabbitmq_event_bus_exchange
end

#rabbitmq_hostObject

Returns the value of attribute rabbitmq_host.



21
22
23
# File 'lib/outboxable/configuration.rb', line 21

def rabbitmq_host
  @rabbitmq_host
end

#rabbitmq_passwordObject

Returns the value of attribute rabbitmq_password.



21
22
23
# File 'lib/outboxable/configuration.rb', line 21

def rabbitmq_password
  @rabbitmq_password
end

#rabbitmq_portObject

Returns the value of attribute rabbitmq_port.



21
22
23
# File 'lib/outboxable/configuration.rb', line 21

def rabbitmq_port
  @rabbitmq_port
end

#rabbitmq_userObject

Returns the value of attribute rabbitmq_user.



21
22
23
# File 'lib/outboxable/configuration.rb', line 21

def rabbitmq_user
  @rabbitmq_user
end

#rabbitmq_vhostObject

Returns the value of attribute rabbitmq_vhost.



21
22
23
# File 'lib/outboxable/configuration.rb', line 21

def rabbitmq_vhost
  @rabbitmq_vhost
end