Sha256: 4e48b7c214b213cbfd50cd5b5f3484f2b8d2a34426b7908d08b258a3fb385e15

Contents?: true

Size: 1.47 KB

Versions: 7

Compression:

Stored size: 1.47 KB

Contents

require 'logger'

module Ratchetio
  class Configuration

    attr_accessor :access_token
    attr_accessor :branch
    attr_accessor :default_logger
    attr_accessor :enabled
    attr_accessor :endpoint
    attr_accessor :write_to_file
    attr_accessor :filepath
    attr_accessor :environment
    attr_accessor :exception_level_filters
    attr_accessor :framework
    attr_accessor :logger
    attr_accessor :person_method
    attr_accessor :person_id_method
    attr_accessor :person_username_method
    attr_accessor :person_email_method
    attr_accessor :root
    attr_accessor :scrub_fields
    attr_accessor :use_async
    attr_accessor :async_handler

    DEFAULT_ENDPOINT = 'https://submit.ratchet.io/api/1/item/'

    def initialize
      @default_logger = lambda { Logger.new(STDERR) }
      @enabled = true
      @endpoint = DEFAULT_ENDPOINT
      @write_to_file = false
      @framework = 'Plain'
      @exception_level_filters = {
        'ActiveRecord::RecordNotFound' => 'warning',
        'AbstractController::ActionNotFound' => 'warning',
        'ActionController::RoutingError' => 'warning'
      }
      @person_method = 'current_user'
      @person_id_method = 'id'
      @person_username_method = 'username'
      @person_email_method = 'email'
      @scrub_fields = [:passwd, :password, :password_confirmation, :secret]
      @use_async = false
      @async_handler = nil
    end

    # allow params to be read like a hash
    def [](option)
      send(option)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ratchetio-0.5.3 lib/ratchetio/configuration.rb
ratchetio-0.5.2 lib/ratchetio/configuration.rb
ratchetio-0.5.1 lib/ratchetio/configuration.rb
ratchetio-0.5.0 lib/ratchetio/configuration.rb
ratchetio-0.4.11 lib/ratchetio/configuration.rb
ratchetio-0.4.10 lib/ratchetio/configuration.rb
ratchetio-0.4.9 lib/ratchetio/configuration.rb