Class: Trabox::Command::Relay::Configuration

Inherits:
Configuration show all
Defined in:
lib/trabox/commands/relay/configuration.rb

Constant Summary collapse

DEFAULT_SELECT_LIMIT =
3
DEFAULT_INTERVAL =
5
DEFAULT_LOCK =
true

Constants inherited from Configuration

Configuration::DEFAULT_LOG_LEVEL

Instance Attribute Summary collapse

Attributes inherited from Configuration

#log_level

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



43
44
45
46
47
48
49
# File 'lib/trabox/commands/relay/configuration.rb', line 43

def initialize
  @limit = ENV['TRABOX_RELAYER_LIMIT'] || DEFAULT_SELECT_LIMIT
  @interval = ENV['TRABOX_RELAYER_INTERVAL'] || DEFAULT_INTERVAL
  @lock = ENV['TRABOX_RELAYER_LOCK'] || DEFAULT_LOCK

  super
end

Instance Attribute Details

#intervalInteger

Returns:

  • (Integer)


38
39
40
41
# File 'lib/trabox/commands/relay/configuration.rb', line 38

attr_accessor :limit,
:interval,
:lock,
:publisher

#limitInteger

Returns:

  • (Integer)


38
39
40
# File 'lib/trabox/commands/relay/configuration.rb', line 38

def limit
  @limit
end

#lockBoolean, String

Returns:

  • (Boolean, String)


38
39
40
41
# File 'lib/trabox/commands/relay/configuration.rb', line 38

attr_accessor :limit,
:interval,
:lock,
:publisher

#publisherTrabox::Publisher, Class

Returns:



38
39
40
41
# File 'lib/trabox/commands/relay/configuration.rb', line 38

attr_accessor :limit,
:interval,
:lock,
:publisher

Instance Method Details

#checkObject



55
56
57
58
59
# File 'lib/trabox/commands/relay/configuration.rb', line 55

def check
  return if @publisher.respond_to?(:publish)

  raise 'Relay Configuration: config.publisher must be have :publish method.'
end