Class: Mqjob::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/mqjob.rb

Defined Under Namespace

Classes: Hooks

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clientObject

Returns the value of attribute client.



47
48
49
# File 'lib/mqjob.rb', line 47

def client
  @client
end

#daemonizeObject

Returns the value of attribute daemonize.



47
48
49
# File 'lib/mqjob.rb', line 47

def daemonize
  @daemonize
end

#hooksObject

Returns the value of attribute hooks.



52
53
54
# File 'lib/mqjob.rb', line 52

def hooks
  @hooks
end

#loggerObject

Returns the value of attribute logger.



52
53
54
# File 'lib/mqjob.rb', line 52

def logger
  @logger
end

#pluginObject

Returns the value of attribute plugin.



47
48
49
# File 'lib/mqjob.rb', line 47

def plugin
  @plugin
end

#subscription_modeObject

Returns the value of attribute subscription_mode.



47
48
49
# File 'lib/mqjob.rb', line 47

def subscription_mode
  @subscription_mode
end

#threadsObject

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