Class: Faultline::Config
- Inherits:
-
Airbrake::Config
- Object
- Airbrake::Config
- Faultline::Config
- Defined in:
- lib/faultline/config.rb,
lib/faultline/config/validator.rb
Defined Under Namespace
Classes: Validator
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
- #endpoint ⇒ Object
-
#notifications ⇒ Object
Returns the value of attribute notifications.
-
#project ⇒ Object
Returns the value of attribute project.
Instance Method Summary collapse
-
#initialize(user_config = {}) ⇒ Config
constructor
A new instance of Config.
- #valid? ⇒ Boolean
Constructor Details
#initialize(user_config = {}) ⇒ Config
Returns a new instance of Config.
8 9 10 11 |
# File 'lib/faultline/config.rb', line 8 def initialize(user_config = {}) super @validator = Faultline::Config::Validator.new(self) end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
4 5 6 |
# File 'lib/faultline/config.rb', line 4 def api_key @api_key end |
#endpoint ⇒ Object
13 14 15 16 |
# File 'lib/faultline/config.rb', line 13 def endpoint return nil if @endpoint.nil? URI.parse(File.join(@endpoint, '/projects/', "/#{@project}/", '/errors')) end |
#notifications ⇒ Object
Returns the value of attribute notifications.
6 7 8 |
# File 'lib/faultline/config.rb', line 6 def notifications @notifications end |
#project ⇒ Object
Returns the value of attribute project.
3 4 5 |
# File 'lib/faultline/config.rb', line 3 def project @project end |
Instance Method Details
#valid? ⇒ Boolean
18 19 20 21 22 23 24 25 26 |
# File 'lib/faultline/config.rb', line 18 def valid? return true if ignored_environment? return false unless @validator.valid_project? return false unless @validator.valid_api_key? return false unless @validator.valid_endpoint? return false unless @validator.valid_environment? true end |