class Vitals::Configuration

Attributes

environment[RW]
facility[RW]
format[RW]
host[RW]
reporter[RW]

Public Class Methods

new() click to toggle source
# 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

Public Instance Methods

build_format() click to toggle source
# File lib/vitals/configuration.rb, line 28
def build_format
  @format.new(
    environment: self.environment,
    facility: self.facility,
    host: self.host
  )
end
path_sep() click to toggle source
# File lib/vitals/configuration.rb, line 24
def path_sep
  Vitals::Utils.path_sep = val
end
path_sep=(val) click to toggle source

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

# File lib/vitals/configuration.rb, line 20
def path_sep=(val)
  Vitals::Utils.path_sep = val
end

Private Instance Methods

fetch_development() click to toggle source
# File lib/vitals/configuration.rb, line 38
def fetch_development
  ENV["RACK_ENV"] || ENV["RAILS_ENV"] || ENV["NODE_ENV"] || "development"
end
fetch_host() click to toggle source
# File lib/vitals/configuration.rb, line 42
def fetch_host
  Vitals::Utils.hostname
end