Sha256: 5fd31ff7c5f55dca19f9aa2c5fac725ef79f6324c5079d1df8bc49d816faaefc

Contents?: true

Size: 1.74 KB

Versions: 1

Compression:

Stored size: 1.74 KB

Contents

module Raygun
  class Configuration

    # Your Raygun API Key - this can be found on your dashboard at Raygun.io
    attr_accessor :api_key

    # Array of exception classes to ignore
    attr_accessor :ignore

    # Version to use
    attr_accessor :version

    # Custom Data to send with each exception
    attr_accessor :custom_data

    # Logger to use when if we find an exception :)
    attr_accessor :logger

    # Should we silence exception reporting (e.g in Development environments)
    attr_accessor :silence_reporting

    # Failsafe logger (for exceptions that happen when we're attempting to report exceptions)
    attr_accessor :failsafe_logger

    # Which controller method should we call to find out the affected user?
    attr_accessor :affected_user_method

    # Which methods should we try on the affected user object in order to get an identifier
    attr_accessor :affected_user_identifier_methods

    # Exception classes to ignore by default
    IGNORE_DEFAULT = ['ActiveRecord::RecordNotFound',
                      'ActionController::RoutingError',
                      'ActionController::InvalidAuthenticityToken',
                      'CGI::Session::CookieStore::TamperedWithCookie',
                      'ActionController::UnknownAction',
                      'AbstractController::ActionNotFound',
                      'Mongoid::Errors::DocumentNotFound']

    def initialize
      # set default attribute values
      @ignore                           = IGNORE_DEFAULT
      @custom_data                      = {}
      @silence_reporting                = nil
      @affected_user_method             = :current_user
      @affected_user_identifier_methods = [ :email, :username, :id ]
    end

    def [](key)
      send(key)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
raygun4ruby-0.0.9 lib/raygun/configuration.rb