Class: Daemonizer::Handler

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

Direct Known Subclasses

FakeHandler

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Handler

Returns a new instance of Handler.



7
8
9
# File 'lib/daemonizer/handler.rb', line 7

def initialize(options = {})
  @options = options
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/daemonizer/handler.rb', line 5

def logger
  @logger
end

#worker_idObject

Returns the value of attribute worker_id.



3
4
5
# File 'lib/daemonizer/handler.rb', line 3

def worker_id
  @worker_id
end

#workers_countObject

Returns the value of attribute workers_count.



4
5
6
# File 'lib/daemonizer/handler.rb', line 4

def workers_count
  @workers_count
end

Instance Method Details

#before_init(block) ⇒ Object



11
12
13
# File 'lib/daemonizer/handler.rb', line 11

def before_init(block)
  block.call
end

#option(key) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/daemonizer/handler.rb', line 15

def option(key)
  if option = @options[key.to_sym]
    option.value(self)
  else
    nil
  end
end