class SendSonar::Configuration
Constants
- ALLOWED_ENVS
- ENV_URLS
Attributes
publishable_key[W]
token[W]
Public Instance Methods
env()
click to toggle source
# File lib/send_sonar/configuration.rb, line 10 def env @env || :sandbox end
env=(env_sym)
click to toggle source
# File lib/send_sonar/configuration.rb, line 22 def env=(env_sym) if ALLOWED_ENVS.include?(env_sym.to_s) @env = env_sym.to_s else raise SendSonar::ConfigurationError.new("You attempted to set SendSonar env to #{env_sym}. Should be one of #{env_choices}") end end
publishable_key()
click to toggle source
# File lib/send_sonar/configuration.rb, line 18 def publishable_key @publishable_key || raise(SendSonar::ConfigurationError.new('You need to set your publishable key, see SendSonar Readme')) end
token()
click to toggle source
# File lib/send_sonar/configuration.rb, line 14 def token @token || raise(SendSonar::ConfigurationError.new('You need to set your token, see SendSonar Readme')) end
Private Instance Methods
env_choices()
click to toggle source
# File lib/send_sonar/configuration.rb, line 32 def env_choices (ALLOWED_ENVS - ['local']).join(', ') end