Class: ExceptionDog::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/exception_dog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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.tags = []
  self.logger = Logger.new(STDOUT)
  self.ignore_exceptions = []
end

Instance Attribute Details

#agent_hostObject

Returns the value of attribute agent_host.



20
21
22
# File 'lib/exception_dog.rb', line 20

def agent_host
  @agent_host
end

#agent_portObject

Returns the value of attribute agent_port.



21
22
23
# File 'lib/exception_dog.rb', line 21

def agent_port
  @agent_port
end

#alert_typeObject

Returns the value of attribute alert_type.



14
15
16
# File 'lib/exception_dog.rb', line 14

def alert_type
  @alert_type
end

#api_keyObject

Returns the value of attribute api_key.



11
12
13
# File 'lib/exception_dog.rb', line 11

def api_key
  @api_key
end

#app_nameObject

Returns the value of attribute app_name.



12
13
14
# File 'lib/exception_dog.rb', line 12

def app_name
  @app_name
end

#environmentObject

Returns the value of attribute environment.



15
16
17
# File 'lib/exception_dog.rb', line 15

def environment
  @environment
end

#ignore_exceptionsObject

Returns the value of attribute ignore_exceptions.



24
25
26
# File 'lib/exception_dog.rb', line 24

def ignore_exceptions
  @ignore_exceptions
end

#loggerObject

Returns the value of attribute logger.



16
17
18
# File 'lib/exception_dog.rb', line 16

def logger
  @logger
end

#notifierObject

Returns the value of attribute notifier.



22
23
24
# File 'lib/exception_dog.rb', line 22

def notifier
  @notifier
end

#notifier_instanceObject

Returns the value of attribute notifier_instance.



23
24
25
# File 'lib/exception_dog.rb', line 23

def notifier_instance
  @notifier_instance
end

#service_nameObject

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_nameObject

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

#tagsObject

Returns the value of attribute tags.



18
19
20
# File 'lib/exception_dog.rb', line 18

def tags
  @tags
end

#test_modeObject

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

#errorsObject



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

Returns:

  • (Boolean)


45
46
47
# File 'lib/exception_dog.rb', line 45

def valid?
  errors.empty?
end