Class: HireFire::Configuration

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

Defined Under Namespace

Classes: LogQueueMetricsUnsupportedError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



13
14
15
16
17
# File 'lib/hirefire/configuration.rb', line 13

def initialize
  @web = nil
  @workers = []
  @logger = Logger.new($stdout)
end

Instance Attribute Details

#log_queue_metricsObject



27
28
29
# File 'lib/hirefire/configuration.rb', line 27

def log_queue_metrics
  @log_queue_metrics ||= false
end

#loggerObject

Returns the value of attribute logger.



11
12
13
# File 'lib/hirefire/configuration.rb', line 11

def logger
  @logger
end

#webObject (readonly)

Returns the value of attribute web.



9
10
11
# File 'lib/hirefire/configuration.rb', line 9

def web
  @web
end

#workersObject (readonly)

Returns the value of attribute workers.



9
10
11
# File 'lib/hirefire/configuration.rb', line 9

def workers
  @workers
end

Instance Method Details

#dyno(name, &block) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/hirefire/configuration.rb', line 19

def dyno(name, &block)
  if name.to_s == "web"
    @web = Web.new
  else
    @workers << Worker.new(name, &block)
  end
end