Class: Telebugs::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/telebugs/config.rb

Constant Summary collapse

ERROR_API_URL =
"https://api.telebugs.com/2024-03-28/errors"

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



23
24
25
# File 'lib/telebugs/config.rb', line 23

def initialize
  reset
end

Class Attribute Details

.instanceObject



18
19
20
# File 'lib/telebugs/config.rb', line 18

def instance
  @instance ||= new
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



7
8
9
# File 'lib/telebugs/config.rb', line 7

def api_key
  @api_key
end

#api_urlObject

Returns the value of attribute api_url.



10
11
12
# File 'lib/telebugs/config.rb', line 10

def api_url
  @api_url
end

#environmentObject

Returns the value of attribute environment.



10
11
12
# File 'lib/telebugs/config.rb', line 10

def environment
  @environment
end

#ignore_environmentsObject

Returns the value of attribute ignore_environments.



10
11
12
# File 'lib/telebugs/config.rb', line 10

def ignore_environments
  @ignore_environments
end

#middlewareObject

Returns the value of attribute middleware.



7
8
9
# File 'lib/telebugs/config.rb', line 7

def middleware
  @middleware
end

#root_directoryObject

Returns the value of attribute root_directory.



10
11
12
# File 'lib/telebugs/config.rb', line 10

def root_directory
  @root_directory
end

Instance Method Details

#resetObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/telebugs/config.rb', line 27

def reset
  self.api_key = nil
  self.api_url = ERROR_API_URL

  @middleware = MiddlewareStack.new
  @middleware.use Middleware::GemRootFilter.new

  self.root_directory = (defined?(Bundler) && Bundler.root) || Dir.pwd
  self.environment = ""
  self.ignore_environments = []
end