Class: Trabox::Command::Relay::Configuration
- Inherits:
-
Command::Configuration
- Object
- Command::Configuration
- Trabox::Command::Relay::Configuration
- Defined in:
- lib/trabox/commands/relay/configuration.rb
Constant Summary collapse
- DEFAULT_SELECT_LIMIT =
3- DEFAULT_INTERVAL =
5- DEFAULT_LOCK =
true
Instance Attribute Summary collapse
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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
#interval ⇒ Integer
38 39 40 41 |
# File 'lib/trabox/commands/relay/configuration.rb', line 38 attr_accessor :limit, :interval, :lock, :publisher |
#limit ⇒ Integer
38 39 40 |
# File 'lib/trabox/commands/relay/configuration.rb', line 38 def limit @limit end |
#lock ⇒ Boolean, String
38 39 40 41 |
# File 'lib/trabox/commands/relay/configuration.rb', line 38 attr_accessor :limit, :interval, :lock, :publisher |
#publisher ⇒ Trabox::Publisher, Class
38 39 40 41 |
# File 'lib/trabox/commands/relay/configuration.rb', line 38 attr_accessor :limit, :interval, :lock, :publisher |
Instance Method Details
#check ⇒ Object
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 |