Class: SidekiqVigil::Config::NotifierDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq_vigil/config.rb

Constant Summary collapse

SECRET_KEYS =
%i[webhook_url routes bot_token url].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, klass:, options:) ⇒ NotifierDefinition

Returns a new instance of NotifierDefinition.



16
17
18
19
20
# File 'lib/sidekiq_vigil/config.rb', line 16

def initialize(name:, klass:, options:)
  @name = name
  @klass = klass
  @options = options
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



14
15
16
# File 'lib/sidekiq_vigil/config.rb', line 14

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



14
15
16
# File 'lib/sidekiq_vigil/config.rb', line 14

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



14
15
16
# File 'lib/sidekiq_vigil/config.rb', line 14

def options
  @options
end

Instance Method Details

#inspectObject



22
23
24
25
26
27
28
# File 'lib/sidekiq_vigil/config.rb', line 22

def inspect
  safe_options = options.transform_values.with_index do |value, _index|
    value.is_a?(Hash) ? value.transform_values { "[FILTERED]" } : value
  end
  SECRET_KEYS.each { |key| safe_options[key] = "[FILTERED]" if safe_options.key?(key) }
  "#<#{self.class} name=#{name.inspect} options=#{safe_options.inspect}>"
end