Class: ExceptionDog::Configuration
- Inherits:
-
Object
- Object
- ExceptionDog::Configuration
- Defined in:
- lib/exception_dog.rb
Instance Attribute Summary collapse
-
#agent_host ⇒ Object
Returns the value of attribute agent_host.
-
#agent_port ⇒ Object
Returns the value of attribute agent_port.
-
#alert_type ⇒ Object
Returns the value of attribute alert_type.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#ignore_exceptions ⇒ Object
Returns the value of attribute ignore_exceptions.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#notifier ⇒ Object
Returns the value of attribute notifier.
-
#notifier_instance ⇒ Object
Returns the value of attribute notifier_instance.
-
#service_name ⇒ Object
Returns the value of attribute service_name.
-
#source_type_name ⇒ Object
Returns the value of attribute source_type_name.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#test_mode ⇒ Object
Returns the value of attribute test_mode.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/exception_dog.rb', line 26 def initialize self.source_type_name = 'my_apps' self.alert_type = 'error' self.environment = 'prod' self.test_mode = false self.agent_host = 'localhost' self.agent_port = 8125 self. = [] self.logger = Logger.new(STDOUT) self.ignore_exceptions = [] end |
Instance Attribute Details
#agent_host ⇒ Object
Returns the value of attribute agent_host.
20 21 22 |
# File 'lib/exception_dog.rb', line 20 def agent_host @agent_host end |
#agent_port ⇒ Object
Returns the value of attribute agent_port.
21 22 23 |
# File 'lib/exception_dog.rb', line 21 def agent_port @agent_port end |
#alert_type ⇒ Object
Returns the value of attribute alert_type.
14 15 16 |
# File 'lib/exception_dog.rb', line 14 def alert_type @alert_type end |
#api_key ⇒ Object
Returns the value of attribute api_key.
11 12 13 |
# File 'lib/exception_dog.rb', line 11 def api_key @api_key end |
#app_name ⇒ Object
Returns the value of attribute app_name.
12 13 14 |
# File 'lib/exception_dog.rb', line 12 def app_name @app_name end |
#environment ⇒ Object
Returns the value of attribute environment.
15 16 17 |
# File 'lib/exception_dog.rb', line 15 def environment @environment end |
#ignore_exceptions ⇒ Object
Returns the value of attribute ignore_exceptions.
24 25 26 |
# File 'lib/exception_dog.rb', line 24 def ignore_exceptions @ignore_exceptions end |
#logger ⇒ Object
Returns the value of attribute logger.
16 17 18 |
# File 'lib/exception_dog.rb', line 16 def logger @logger end |
#notifier ⇒ Object
Returns the value of attribute notifier.
22 23 24 |
# File 'lib/exception_dog.rb', line 22 def notifier @notifier end |
#notifier_instance ⇒ Object
Returns the value of attribute notifier_instance.
23 24 25 |
# File 'lib/exception_dog.rb', line 23 def notifier_instance @notifier_instance end |
#service_name ⇒ Object
Returns the value of attribute service_name.
17 18 19 |
# File 'lib/exception_dog.rb', line 17 def service_name @service_name end |
#source_type_name ⇒ Object
Returns the value of attribute source_type_name.
13 14 15 |
# File 'lib/exception_dog.rb', line 13 def source_type_name @source_type_name end |
#tags ⇒ Object
Returns the value of attribute tags.
18 19 20 |
# File 'lib/exception_dog.rb', line 18 def @tags end |
#test_mode ⇒ Object
Returns the value of attribute test_mode.
19 20 21 |
# File 'lib/exception_dog.rb', line 19 def test_mode @test_mode end |
Instance Method Details
#errors ⇒ Object
38 39 40 41 42 43 |
# File 'lib/exception_dog.rb', line 38 def errors @errors = [] @errors << "No service_name supplied" unless service_name @errors << "No notifier configured" unless notifier @errors end |
#valid? ⇒ Boolean
45 46 47 |
# File 'lib/exception_dog.rb', line 45 def valid? errors.empty? end |