Module: Jobi

Extended by:
Utils
Defined in:
lib/jobi.rb,
lib/jobi/job.rb,
lib/jobi/utils.rb,
lib/jobi/runner.rb,
lib/jobi/message.rb,
lib/jobi/version.rb,
lib/jobi/configuration.rb,
lib/jobi/config/rabbitmq.rb,
lib/jobi/clients/rabbitmq.rb,
lib/jobi/consumers/rabbitmq.rb

Defined Under Namespace

Modules: Clients, Config, Consumers, Utils Classes: Configuration, Error, Job, Message, Runner

Constant Summary collapse

VERSION =
"0.2.1"

Class Method Summary collapse

Methods included from Utils

constantize, generate_job_id

Class Method Details

.client_class_nameObject



34
35
36
# File 'lib/jobi.rb', line 34

def client_class_name
  configuration.client.capitalize
end

.configurationObject



16
17
18
# File 'lib/jobi.rb', line 16

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



20
21
22
23
24
# File 'lib/jobi.rb', line 20

def configure
  yield(configuration)
  configuration.setup_logger
  start
end

.consumer?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/jobi.rb', line 38

def consumer?
  configuration.act_as_consumer
end

.loggerObject



26
27
28
# File 'lib/jobi.rb', line 26

def logger
  configuration.logger
end

.publisher?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/jobi.rb', line 42

def publisher?
  configuration.act_as_publisher
end

.sessionObject



30
31
32
# File 'lib/jobi.rb', line 30

def session
  @session ||= client_class.new(configuration.send(client_config_method))
end