Class: Tinet::Setting

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

Constant Summary collapse

ROOT =
File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
DEFAULT_SPECFILE_PATH =
'./spec.yml'.freeze

Instance Method Summary collapse

Instance Method Details

#loggerLogger

Returns:

  • (Logger)


25
26
27
28
29
30
# File 'lib/tinet/setting.rb', line 25

def logger
  @logger ||= Logger.new($stderr).tap do |logger|
    logger.formatter = proc { |_sev, _dtm, _name, message| message + "\n" }
    logger.level = Logger::INFO
  end
end

#logger=(logger) ⇒ Logger

Parameters:

  • logger (Logger)

Returns:

  • (Logger)


34
35
36
# File 'lib/tinet/setting.rb', line 34

def logger=(logger)
  @logger = logger
end

#namespaceString

Returns:

  • (String)


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

def namespace
  @namespace ||= 'tinet'
end

#namespace=(namespace) ⇒ String

Parameters:

  • namespace (String)

Returns:

  • (String)


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

def namespace=(namespace)
  @namespace = namespace
end

#rootString

Returns:

  • (String)


9
10
11
# File 'lib/tinet/setting.rb', line 9

def root
  ROOT
end