Class: AcpcTableManager::Config
- Inherits:
-
Object
- Object
- AcpcTableManager::Config
- Includes:
- SimpleLogging
- Defined in:
- lib/acpc_table_manager/config.rb
Constant Summary collapse
- THIS_MACHINE =
Socket.gethostname
- DEALER_HOST =
THIS_MACHINE
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#log_directory ⇒ Object
readonly
Returns the value of attribute log_directory.
-
#match_log_directory ⇒ Object
readonly
Returns the value of attribute match_log_directory.
-
#my_log_directory ⇒ Object
readonly
Returns the value of attribute my_log_directory.
-
#proxy_pids_file ⇒ Object
readonly
Returns the value of attribute proxy_pids_file.
Instance Method Summary collapse
- #dealer_host ⇒ Object
-
#initialize(file_path, log_directory_, match_log_directory_, proxy_pids_file_, interpolation_hash) ⇒ Config
constructor
A new instance of Config.
- #this_machine ⇒ Object
Methods included from SimpleLogging
Constructor Details
#initialize(file_path, log_directory_, match_log_directory_, proxy_pids_file_, interpolation_hash) ⇒ Config
Returns a new instance of Config.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/acpc_table_manager/config.rb', line 24 def initialize(file_path, log_directory_, match_log_directory_, proxy_pids_file_, interpolation_hash) @file = file_path JSON.parse(File.read(file_path)).each do |constant, val| define_singleton_method(constant.to_sym) do ::AcpcTableManager.interpolate_all_strings(val, interpolation_hash) end end @log_directory = log_directory_ @match_log_directory = match_log_directory_ @my_log_directory = File.join(@log_directory, 'acpc_table_manager') @proxy_pids_file = proxy_pids_file_ @logger = Logger.from_file_name(File.join(@my_log_directory, 'config.log')) end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
22 23 24 |
# File 'lib/acpc_table_manager/config.rb', line 22 def file @file end |
#log_directory ⇒ Object (readonly)
Returns the value of attribute log_directory.
22 23 24 |
# File 'lib/acpc_table_manager/config.rb', line 22 def log_directory @log_directory end |
#match_log_directory ⇒ Object (readonly)
Returns the value of attribute match_log_directory.
22 23 24 |
# File 'lib/acpc_table_manager/config.rb', line 22 def match_log_directory @match_log_directory end |
#my_log_directory ⇒ Object (readonly)
Returns the value of attribute my_log_directory.
22 23 24 |
# File 'lib/acpc_table_manager/config.rb', line 22 def my_log_directory @my_log_directory end |
#proxy_pids_file ⇒ Object (readonly)
Returns the value of attribute proxy_pids_file.
22 23 24 |
# File 'lib/acpc_table_manager/config.rb', line 22 def proxy_pids_file @proxy_pids_file end |
Instance Method Details
#dealer_host ⇒ Object
39 |
# File 'lib/acpc_table_manager/config.rb', line 39 def dealer_host() DEALER_HOST end |
#this_machine ⇒ Object
38 |
# File 'lib/acpc_table_manager/config.rb', line 38 def this_machine() THIS_MACHINE end |