Class: Telebugs::Config
- Inherits:
-
Object
- Object
- Telebugs::Config
- 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
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_url ⇒ Object
Returns the value of attribute api_url.
-
#middleware ⇒ Object
Returns the value of attribute middleware.
-
#root_directory ⇒ Object
Returns the value of attribute root_directory.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
21 22 23 |
# File 'lib/telebugs/config.rb', line 21 def initialize reset end |
Class Attribute Details
.instance ⇒ Object
16 17 18 |
# File 'lib/telebugs/config.rb', line 16 def instance @instance ||= new end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/telebugs/config.rb', line 7 def api_key @api_key end |
#api_url ⇒ Object
Returns the value of attribute api_url.
10 11 12 |
# File 'lib/telebugs/config.rb', line 10 def api_url @api_url end |
#middleware ⇒ Object
Returns the value of attribute middleware.
7 8 9 |
# File 'lib/telebugs/config.rb', line 7 def middleware @middleware end |
#root_directory ⇒ Object
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
#reset ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/telebugs/config.rb', line 38 def reset self.api_key = nil self.api_url = ERROR_API_URL self.root_directory = File.realpath( (defined?(Bundler) && Bundler.root) || Dir.pwd ) @middleware = MiddlewareStack.new @middleware.use Middleware::GemRootFilter.new @middleware.use Middleware::RootDirectoryFilter.new(root_directory) end |