Class: SaloPulse::Configuration
- Inherits:
-
Object
- Object
- SaloPulse::Configuration
- Defined in:
- lib/salopulse/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 13 |
# File 'lib/salopulse/configuration.rb', line 7 def initialize @api_key = ENV['SALO_PULSE_API_KEY'] @environment = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development' @endpoint = ENV['SALO_PULSE_ENDPOINT'] || 'https://api.salopulse.com/v1/ingest' @timeout = 1.0 @enabled = true end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/salopulse/configuration.rb', line 5 def api_key @api_key end |
#enabled ⇒ Object
Returns the value of attribute enabled.
5 6 7 |
# File 'lib/salopulse/configuration.rb', line 5 def enabled @enabled end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
5 6 7 |
# File 'lib/salopulse/configuration.rb', line 5 def endpoint @endpoint end |
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/salopulse/configuration.rb', line 5 def environment @environment end |
#timeout ⇒ Object
Returns the value of attribute timeout.
5 6 7 |
# File 'lib/salopulse/configuration.rb', line 5 def timeout @timeout end |
Instance Method Details
#valid? ⇒ Boolean
15 16 17 |
# File 'lib/salopulse/configuration.rb', line 15 def valid? @enabled && @api_key && !@api_key.strip.empty? end |