Class: Honeybadger::Config::Ruby Private

Inherits:
Mash
  • Object
show all
Defined in:
lib/honeybadger/config/ruby.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary

Constants inherited from Mash

Mash::KEYS

Instance Method Summary collapse

Methods inherited from Mash

#initialize, #to_hash

Constructor Details

This class inherits a constructor from Honeybadger::Config::Mash

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Honeybadger::Config::Mash

Instance Method Details

#backendObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



85
86
87
# File 'lib/honeybadger/config/ruby.rb', line 85

def backend
  get(:backend) || config.backend
end

#backend=(backend) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



81
82
83
# File 'lib/honeybadger/config/ruby.rb', line 81

def backend=(backend)
  hash[:backend] = backend
end

#backtrace_filter(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



113
114
115
116
117
118
119
120
# File 'lib/honeybadger/config/ruby.rb', line 113

def backtrace_filter(&block)
  if block_given?
    logger.warn('DEPRECATED: backtrace_filter is deprecated. Please use before_notify instead. See https://docs.honeybadger.io/ruby/support/v4-upgrade#backtrace_filter')
    hash[:backtrace_filter] = block if block_given?
  end

  get(:backtrace_filter)
end

#before_event(action = nil, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



101
102
103
104
105
106
107
108
109
110
111
# File 'lib/honeybadger/config/ruby.rb', line 101

def before_event(action = nil, &block)
  hooks = Array(get(:before_event)).dup

  if action && validate_before_action(action, 'event')
    hooks << action
  elsif block_given? && validate_before_action(block, 'event')
    hooks << block
  end

  hash[:before_event] = hooks
end

#before_notify(action = nil, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



89
90
91
92
93
94
95
96
97
98
99
# File 'lib/honeybadger/config/ruby.rb', line 89

def before_notify(action = nil, &block)
  hooks = Array(get(:before_notify)).dup

  if action && validate_before_action(action, 'notify')
    hooks << action
  elsif block_given? && validate_before_action(block, 'notify')
    hooks << block
  end

  hash[:before_notify] = hooks
end

#exception_filter(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



122
123
124
125
126
127
128
129
# File 'lib/honeybadger/config/ruby.rb', line 122

def exception_filter(&block)
  if block_given?
    logger.warn('DEPRECATED: exception_filter is deprecated. Please use before_notify instead. See https://docs.honeybadger.io/ruby/support/v4-upgrade#exception_filter')
    hash[:exception_filter] = block
  end

  get(:exception_filter)
end

#exception_fingerprint(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



131
132
133
134
135
136
137
138
# File 'lib/honeybadger/config/ruby.rb', line 131

def exception_fingerprint(&block)
  if block_given?
    logger.warn('DEPRECATED: exception_fingerprint is deprecated. Please use before_notify instead. See https://docs.honeybadger.io/ruby/support/v4-upgrade#exception_fingerprint')
    hash[:exception_fingerprint] = block
  end

  get(:exception_fingerprint)
end

#loggerObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



77
78
79
# File 'lib/honeybadger/config/ruby.rb', line 77

def logger
  get(:logger) || config.logger
end

#logger=(logger) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



73
74
75
# File 'lib/honeybadger/config/ruby.rb', line 73

def logger=(logger)
  hash[:logger] = logger
end