Class: Errorgap::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/errorgap/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/errorgap/configuration.rb', line 17

def initialize
  @endpoint = ENV.fetch("ERRORGAP_ENDPOINT", "http://127.0.0.1:3030")
  @project_id = ENV["ERRORGAP_PROJECT_ID"]
  @project_slug = ENV["ERRORGAP_PROJECT_SLUG"]
  @api_key = ENV["ERRORGAP_API_KEY"]
  @environment = ENV.fetch("RAILS_ENV", ENV.fetch("RACK_ENV", "development"))
  @root_directory = Dir.pwd
  @async = true
  @filter_keys = %w[password password_confirmation token secret api_key authorization cookie]
  @apm_enabled = false
  @apm_sample_rate = 1.0
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def api_key
  @api_key
end

#apm_enabledObject

Returns the value of attribute apm_enabled.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def apm_enabled
  @apm_enabled
end

#apm_sample_rateObject

Returns the value of attribute apm_sample_rate.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def apm_sample_rate
  @apm_sample_rate
end

#asyncObject

Returns the value of attribute async.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def async
  @async
end

#endpointObject

Returns the value of attribute endpoint.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def endpoint
  @endpoint
end

#environmentObject

Returns the value of attribute environment.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def environment
  @environment
end

#filter_keysObject

Returns the value of attribute filter_keys.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def filter_keys
  @filter_keys
end

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def logger
  @logger
end

#project_idObject

Returns the value of attribute project_id.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def project_id
  @project_id
end

#project_slugObject

Returns the value of attribute project_slug.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def project_slug
  @project_slug
end

#root_directoryObject

Returns the value of attribute root_directory.



5
6
7
# File 'lib/errorgap/configuration.rb', line 5

def root_directory
  @root_directory
end

Instance Method Details

#validate!Object

Raises:

  • (ArgumentError)


30
31
32
33
34
# File 'lib/errorgap/configuration.rb', line 30

def validate!
  raise ArgumentError, "Errorgap project_slug is required" if blank?(project_slug)

  true
end