Module: Osbourne::Config::SharedConfigs

Included in:
Osbourne
Defined in:
lib/osbourne/config/shared_configs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#aws_credentials=(value) ⇒ Object (writeonly)

Sets the attribute aws_credentials

Parameters:

  • value

    the value to set the attribute aws_credentials to.



6
7
8
# File 'lib/osbourne/config/shared_configs.rb', line 6

def aws_credentials=(value)
  @aws_credentials = value
end

#configObject



8
9
10
# File 'lib/osbourne/config/shared_configs.rb', line 8

def config
  @config ||= ActiveSupport::OrderedOptions.new
end

#sns_config=(value) ⇒ Object (writeonly)

Sets the attribute sns_config

Parameters:

  • value

    the value to set the attribute sns_config to.



6
7
8
# File 'lib/osbourne/config/shared_configs.rb', line 6

def sns_config=(value)
  @sns_config = value
end

#sqs_config=(value) ⇒ Object (writeonly)

Sets the attribute sqs_config

Parameters:

  • value

    the value to set the attribute sqs_config to.



6
7
8
# File 'lib/osbourne/config/shared_configs.rb', line 6

def sqs_config=(value)
  @sqs_config = value
end

Instance Method Details

#cacheObject



12
13
14
# File 'lib/osbourne/config/shared_configs.rb', line 12

def cache
  config.cache ||= ActiveSupport::Cache::NullStore.new
end

#dead_letterObject



28
29
30
# File 'lib/osbourne/config/shared_configs.rb', line 28

def dead_letter
  config.dead_letter ||= true
end

#lockObject



40
41
42
# File 'lib/osbourne/config/shared_configs.rb', line 40

def lock
  config.lock ||= Osbourne::Locks::NOOP.new
end

#loggerObject



36
37
38
# File 'lib/osbourne/config/shared_configs.rb', line 36

def logger
  config.logger ||= Logger.new("log/osbourne.log")
end

#max_retry_countObject



32
33
34
# File 'lib/osbourne/config/shared_configs.rb', line 32

def max_retry_count
  @max_retry_count ||= (config.max_retry_count.presence || 5).to_s
end

#prefixObject



52
53
54
# File 'lib/osbourne/config/shared_configs.rb', line 52

def prefix
  config.prefix ||= Rails.env
end

#sleep_timeObject



44
45
46
# File 'lib/osbourne/config/shared_configs.rb', line 44

def sleep_time
  config.sleep_time ||= 15
end

#test_mode!Object



20
21
22
# File 'lib/osbourne/config/shared_configs.rb', line 20

def test_mode!
  @test_mode = true
end

#test_mode=(test_mode) ⇒ Object



24
25
26
# File 'lib/osbourne/config/shared_configs.rb', line 24

def test_mode=(test_mode)
  @test_mode = test_mode
end

#test_mode?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/osbourne/config/shared_configs.rb', line 16

def test_mode?
  false
end

#threads_per_workerObject



48
49
50
# File 'lib/osbourne/config/shared_configs.rb', line 48

def threads_per_worker
  config.threads_per_worker ||= 5
end