Class: Errorgap::Configuration
- Inherits:
-
Object
- Object
- Errorgap::Configuration
- Defined in:
- lib/errorgap/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#apm_enabled ⇒ Object
Returns the value of attribute apm_enabled.
-
#apm_sample_rate ⇒ Object
Returns the value of attribute apm_sample_rate.
-
#async ⇒ Object
Returns the value of attribute async.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#filter_keys ⇒ Object
Returns the value of attribute filter_keys.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#project_slug ⇒ Object
Returns the value of attribute project_slug.
-
#root_directory ⇒ Object
Returns the value of attribute root_directory.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/errorgap/configuration.rb', line 5 def api_key @api_key end |
#apm_enabled ⇒ Object
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_rate ⇒ Object
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 |
#async ⇒ Object
Returns the value of attribute async.
5 6 7 |
# File 'lib/errorgap/configuration.rb', line 5 def async @async end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
5 6 7 |
# File 'lib/errorgap/configuration.rb', line 5 def endpoint @endpoint end |
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/errorgap/configuration.rb', line 5 def environment @environment end |
#filter_keys ⇒ Object
Returns the value of attribute filter_keys.
5 6 7 |
# File 'lib/errorgap/configuration.rb', line 5 def filter_keys @filter_keys end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/errorgap/configuration.rb', line 5 def logger @logger end |
#project_id ⇒ Object
Returns the value of attribute project_id.
5 6 7 |
# File 'lib/errorgap/configuration.rb', line 5 def project_id @project_id end |
#project_slug ⇒ Object
Returns the value of attribute project_slug.
5 6 7 |
# File 'lib/errorgap/configuration.rb', line 5 def project_slug @project_slug end |
#root_directory ⇒ Object
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
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 |