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

Instance Method Details

#ack_mandatory?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/fleck/core/consumer/configuration.rb', line 58

def ack_mandatory?
  @ack_mandatory ||= !configs[:mandatory].nil?
end

#configsObject



22
23
24
# File 'lib/fleck/core/consumer/configuration.rb', line 22

def configs
  @configs ||= self.class.configs
end

#prefetch_sizeObject



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_nameObject



46
47
48
# File 'lib/fleck/core/consumer/configuration.rb', line 46

def queue_name
  @queue_name ||= configs[:queue]
end

#rmq_exchange_nameObject



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_typeObject



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_hostObject



26
27
28
# File 'lib/fleck/core/consumer/configuration.rb', line 26

def rmq_host
  @rmq_host ||= configs[:host]
end

#rmq_passObject



38
39
40
# File 'lib/fleck/core/consumer/configuration.rb', line 38

def rmq_pass
  @rmq_pass ||= configs.fetch(:password, configs[:pass])
end

#rmq_portObject



30
31
32
# File 'lib/fleck/core/consumer/configuration.rb', line 30

def rmq_port
  @rmq_port ||= configs[:port]
end

#rmq_userObject



34
35
36
# File 'lib/fleck/core/consumer/configuration.rb', line 34

def rmq_user
  @rmq_user ||= configs.fetch(:user, 'guest')
end

#rmq_vhostObject



42
43
44
# File 'lib/fleck/core/consumer/configuration.rb', line 42

def rmq_vhost
  @rmq_vhost ||= configs.fetch(:vhost, '/')
end