Class: Mqjob::Config
- Inherits:
-
Object
- Object
- Mqjob::Config
- Defined in:
- lib/mqjob.rb
Defined Under Namespace
Classes: Hooks
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#daemonize ⇒ Object
Returns the value of attribute daemonize.
-
#hooks ⇒ Object
Returns the value of attribute hooks.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#plugin ⇒ Object
Returns the value of attribute plugin.
-
#subscription_mode ⇒ Object
Returns the value of attribute subscription_mode.
-
#threads ⇒ Object
Returns the value of attribute threads.
Instance Method Summary collapse
- #assign_attributes(opts) ⇒ Object
-
#initialize(opts = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(opts = {}) ⇒ Config
Returns a new instance of Config.
54 55 56 57 58 59 60 61 |
# File 'lib/mqjob.rb', line 54 def initialize(opts = {}) @hooks = Hooks.new(opts.delete(:hooks)) @plugin = :pulsar assign_attributes(opts) remove_empty_instance_variables! end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
47 48 49 |
# File 'lib/mqjob.rb', line 47 def client @client end |
#daemonize ⇒ Object
Returns the value of attribute daemonize.
47 48 49 |
# File 'lib/mqjob.rb', line 47 def daemonize @daemonize end |
#hooks ⇒ Object
Returns the value of attribute hooks.
52 53 54 |
# File 'lib/mqjob.rb', line 52 def hooks @hooks end |
#logger ⇒ Object
Returns the value of attribute logger.
52 53 54 |
# File 'lib/mqjob.rb', line 52 def logger @logger end |
#plugin ⇒ Object
Returns the value of attribute plugin.
47 48 49 |
# File 'lib/mqjob.rb', line 47 def plugin @plugin end |
#subscription_mode ⇒ Object
Returns the value of attribute subscription_mode.
47 48 49 |
# File 'lib/mqjob.rb', line 47 def subscription_mode @subscription_mode end |
#threads ⇒ Object
Returns the value of attribute threads.
47 48 49 |
# File 'lib/mqjob.rb', line 47 def threads @threads end |
Instance Method Details
#assign_attributes(opts) ⇒ Object
80 81 82 83 84 85 86 |
# File 'lib/mqjob.rb', line 80 def assign_attributes(opts) opts.each do |k, v| method = "#{k}=" next unless self.respond_to?(method) self.public_send method, v end end |