Class: Nightwing::Sidekiq::Base
- Inherits:
-
Object
- Object
- Nightwing::Sidekiq::Base
- Defined in:
- lib/nightwing/sidekiq/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
Instance Method Summary collapse
- #client ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 |
# File 'lib/nightwing/sidekiq/base.rb', line 11 def initialize( = {}) @namespace = .fetch(:namespace, "sidekiq") @client = .fetch(:client, Nightwing.client) @logger = .fetch(:logger, Nightwing::Logger.new) @debug = .fetch(:debug, false) end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
9 10 11 |
# File 'lib/nightwing/sidekiq/base.rb', line 9 def logger @logger end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
9 10 11 |
# File 'lib/nightwing/sidekiq/base.rb', line 9 def namespace @namespace end |
Instance Method Details
#client ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/nightwing/sidekiq/base.rb', line 18 def client @client_proxy ||= begin if @debug Nightwing::ClientLogger.new(client: @client, logger: @logger) else @client end end end |