diff options
| author | mo khan <mokhan@users.noreply.github.com> | 2019-04-20 09:32:24 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-20 09:32:24 -0600 |
| commit | bc2274ce4183bee7523665bf8a905a584f20081a (patch) | |
| tree | b336f1e4c305a3d22a2177b5b8e14f2b68989348 /lib/killjoy/amqp_configuration.rb | |
| parent | a7cd8453ab61f3a7b6ab59cda9d051dc725cdead (diff) | |
| parent | 85bd0e5d520109f29011f6eff69e9d2f2e20af26 (diff) | |
Merge pull request #2 from mokhan/kafkamain
Kafka
Diffstat (limited to 'lib/killjoy/amqp_configuration.rb')
| -rw-r--r-- | lib/killjoy/amqp_configuration.rb | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/lib/killjoy/amqp_configuration.rb b/lib/killjoy/amqp_configuration.rb deleted file mode 100644 index 62262f8..0000000 --- a/lib/killjoy/amqp_configuration.rb +++ /dev/null @@ -1,47 +0,0 @@ -module Killjoy - class AMQPConfiguration - attr_reader :environment - - def initialize(environment: ENV.fetch("ENV", "development")) - @environment = environment - end - - def amqp_uri - configuration['amqp_uri'] - end - - def heartbeat - configuration['heartbeat'].to_i - end - - def prefetch - configuration['prefetch'].to_i - end - - def exchange - configuration['exchange'] - end - - def exchange_type - configuration['exchange_type'] - end - - def shards - configuration['shards'].to_i - end - - def to_hash - configuration - end - - private - - def configuration(file = "config/amqp.yml") - @configuration ||= YAML.load(expand_template(file))[environment] - end - - def expand_template(file) - ERB.new(File.read(file)).result(binding) - end - end -end |
