Class: AcpcTableManager::Config
- Inherits:
-
NilDefaultConfig
- Object
- NilDefaultConfig
- 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
Methods inherited from NilDefaultConfig
Constructor Details
#initialize(file_path, log_directory_, match_log_directory_, proxy_pids_file_, interpolation_hash) ⇒ Config
Returns a new instance of Config.
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/acpc_table_manager/config.rb', line 29 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 |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AcpcTableManager::NilDefaultConfig
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
27 28 29 |
# File 'lib/acpc_table_manager/config.rb', line 27 def file @file end |
#log_directory ⇒ Object (readonly)
Returns the value of attribute log_directory.
27 28 29 |
# File 'lib/acpc_table_manager/config.rb', line 27 def log_directory @log_directory end |
#match_log_directory ⇒ Object (readonly)
Returns the value of attribute match_log_directory.
27 28 29 |
# File 'lib/acpc_table_manager/config.rb', line 27 def match_log_directory @match_log_directory end |
#my_log_directory ⇒ Object (readonly)
Returns the value of attribute my_log_directory.
27 28 29 |
# File 'lib/acpc_table_manager/config.rb', line 27 def my_log_directory @my_log_directory end |
#proxy_pids_file ⇒ Object (readonly)
Returns the value of attribute proxy_pids_file.
27 28 29 |
# File 'lib/acpc_table_manager/config.rb', line 27 def proxy_pids_file @proxy_pids_file end |
Instance Method Details
#dealer_host ⇒ Object
44 |
# File 'lib/acpc_table_manager/config.rb', line 44 def dealer_host() DEALER_HOST end |
#this_machine ⇒ Object
43 |
# File 'lib/acpc_table_manager/config.rb', line 43 def this_machine() THIS_MACHINE end |