Class: Vitals::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
# File 'lib/vitals/configuration.rb', line 9

def initialize
  @environment = fetch_development
  @facility = "default"
  @host = fetch_host
  @reporter = Vitals::Reporters::InmemReporter.new
  @format = Vitals::Formats::ProductionFormat
  self.path_sep = '.'
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



3
4
5
# File 'lib/vitals/configuration.rb', line 3

def environment
  @environment
end

#facilityObject

Returns the value of attribute facility.



4
5
6
# File 'lib/vitals/configuration.rb', line 4

def facility
  @facility
end

#formatObject

Returns the value of attribute format.



7
8
9
# File 'lib/vitals/configuration.rb', line 7

def format
  @format
end

#hostObject

Returns the value of attribute host.



5
6
7
# File 'lib/vitals/configuration.rb', line 5

def host
  @host
end

#reporterObject

Returns the value of attribute reporter.



6
7
8
# File 'lib/vitals/configuration.rb', line 6

def reporter
  @reporter
end

Instance Method Details

#build_formatObject



28
29
30
31
32
33
34
# File 'lib/vitals/configuration.rb', line 28

def build_format
  @format.new(
    environment: self.environment,
    facility: self.facility,
    host: self.host
  )
end

#path_sepObject



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

def path_sep
  Vitals::Utils.path_sep = val
end

#path_sep=(val) ⇒ Object

delegate to utils, until this part of the utils finds a new home with a new abstraction



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

def path_sep=(val)
  Vitals::Utils.path_sep = val
end