Class: Prospector::Configuration
- Inherits:
-
Object
- Object
- Prospector::Configuration
- Defined in:
- lib/prospector/configuration.rb
Instance Attribute Summary collapse
- #client_secret ⇒ Object
-
#enabled ⇒ Object
writeonly
Sets the attribute enabled.
- #secret_token ⇒ Object
Instance Method Summary collapse
- #background_adapter ⇒ Object
- #background_adapter=(value) ⇒ Object
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #notified? ⇒ Boolean
- #notify! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 |
# File 'lib/prospector/configuration.rb', line 7 def initialize @notified = false end |
Instance Attribute Details
#client_secret ⇒ Object
37 38 39 |
# File 'lib/prospector/configuration.rb', line 37 def client_secret @client_secret || ENV['PROSPECTOR_CLIENT_SECRET'] || raise(InvalidCredentialsError) end |
#enabled=(value) ⇒ Object (writeonly)
Sets the attribute enabled
3 4 5 |
# File 'lib/prospector/configuration.rb', line 3 def enabled=(value) @enabled = value end |
#secret_token ⇒ Object
33 34 35 |
# File 'lib/prospector/configuration.rb', line 33 def secret_token @secret_token || ENV['PROSPECTOR_SECRET_TOKEN'] || raise(InvalidCredentialsError) end |
Instance Method Details
#background_adapter ⇒ Object
25 26 27 |
# File 'lib/prospector/configuration.rb', line 25 def background_adapter @background_adapter ||= background_adapter_from_env || determine_default_background_adapater end |
#background_adapter=(value) ⇒ Object
29 30 31 |
# File 'lib/prospector/configuration.rb', line 29 def background_adapter=(value) @background_adapter = value.to_sym end |
#enabled? ⇒ Boolean
11 12 13 14 15 |
# File 'lib/prospector/configuration.rb', line 11 def enabled? return @enabled unless @enabled.nil? @enabled = ENV['PROSPECTOR_ENABLED'] == 'true' end |
#notified? ⇒ Boolean
21 22 23 |
# File 'lib/prospector/configuration.rb', line 21 def notified? @notified == true end |
#notify! ⇒ Object
17 18 19 |
# File 'lib/prospector/configuration.rb', line 17 def notify! @notified = true end |