Module: Fleck::Core::Consumer::Configuration::InstanceMethods
- Defined in:
- lib/fleck/core/consumer/configuration.rb
Overview
Defines instance methods to import when ‘Configuration` module is imported.
Instance Method Summary collapse
- #ack_mandatory? ⇒ Boolean
- #configs ⇒ Object
- #prefetch_size ⇒ Object
- #queue_name ⇒ Object
- #rmq_exchange_name ⇒ Object
- #rmq_exchange_type ⇒ Object
- #rmq_host ⇒ Object
- #rmq_pass ⇒ Object
- #rmq_port ⇒ Object
- #rmq_user ⇒ Object
- #rmq_vhost ⇒ Object
Instance Method Details
#ack_mandatory? ⇒ Boolean
58 59 60 |
# File 'lib/fleck/core/consumer/configuration.rb', line 58 def ack_mandatory? @ack_mandatory ||= !configs[:mandatory].nil? end |
#configs ⇒ Object
22 23 24 |
# File 'lib/fleck/core/consumer/configuration.rb', line 22 def configs @configs ||= self.class.configs end |
#prefetch_size ⇒ Object
62 63 64 |
# File 'lib/fleck/core/consumer/configuration.rb', line 62 def prefetch_size @prefetch_size ||= configs.fetch(:prefetch, 100).to_i end |
#queue_name ⇒ Object
46 47 48 |
# File 'lib/fleck/core/consumer/configuration.rb', line 46 def queue_name @queue_name ||= configs[:queue] end |
#rmq_exchange_name ⇒ Object
54 55 56 |
# File 'lib/fleck/core/consumer/configuration.rb', line 54 def rmq_exchange_name @rmq_exchange_name ||= configs.fetch(:exchange_name, '') end |
#rmq_exchange_type ⇒ Object
50 51 52 |
# File 'lib/fleck/core/consumer/configuration.rb', line 50 def rmq_exchange_type @rmq_exchange_type ||= configs.fetch(:exchange_type, :direct) end |
#rmq_host ⇒ Object
26 27 28 |
# File 'lib/fleck/core/consumer/configuration.rb', line 26 def rmq_host @rmq_host ||= configs[:host] end |
#rmq_pass ⇒ Object
38 39 40 |
# File 'lib/fleck/core/consumer/configuration.rb', line 38 def rmq_pass @rmq_pass ||= configs.fetch(:password, configs[:pass]) end |
#rmq_port ⇒ Object
30 31 32 |
# File 'lib/fleck/core/consumer/configuration.rb', line 30 def rmq_port @rmq_port ||= configs[:port] end |
#rmq_user ⇒ Object
34 35 36 |
# File 'lib/fleck/core/consumer/configuration.rb', line 34 def rmq_user @rmq_user ||= configs.fetch(:user, 'guest') end |
#rmq_vhost ⇒ Object
42 43 44 |
# File 'lib/fleck/core/consumer/configuration.rb', line 42 def rmq_vhost @rmq_vhost ||= configs.fetch(:vhost, '/') end |