module Airbrake::Inspectable

Inspectable provides custom inspect methods that reduce clutter printed in REPLs for notifier objects. These custom methods display only essential information such as project id/key and filters.

@since v3.2.6 @api private

Constants

INSPECT_TEMPLATE

@return [String] inspect output template

Public Instance Methods

inspect() click to toggle source

@return [String] customized inspect to lessen the amount of clutter

# File lib/airbrake-ruby/inspectable.rb, line 16
def inspect
  format(
    INSPECT_TEMPLATE,
    classname: self.class.name,
    id: (object_id << 1).to_s(16).rjust(16, '0'),
    project_id: @config.project_id,
    project_key: @config.project_key,
    host: @config.host,
    filter_chain: @filter_chain.inspect,
  )
end
pretty_print(q) click to toggle source

@return [String] {#inspect} for PrettyPrint

# File lib/airbrake-ruby/inspectable.rb, line 29
def pretty_print(q)
  q.text("#<#{self.class}:0x#{(object_id << 1).to_s(16).rjust(16, '0')} ")
  q.text(
    "project_id=\"#{@config.project_id}\" project_key=\"#{@config.project_key}\" " \
    "host=\"#{@config.host}\" filter_chain=",
  )
  q.pp(@filter_chain)
  q.text('>')
end