class Services::Config::Parser
Attributes
config_path[R]
config_structs[R]
Public Class Methods
new(config_path = Services::Config::DEFAULT_CONFIG_PATH)
click to toggle source
# File lib/services/config/parser.rb, line 10 def initialize(config_path = Services::Config::DEFAULT_CONFIG_PATH) @config_path = config_path @config_hash = YAML.load_file(@config_path) @config_structs = nil end
Public Instance Methods
load_config()
click to toggle source
# File lib/services/config/parser.rb, line 16 def load_config begin @config_structs = @config_structs.nil? ? Services::Config::ConfigStruct.new(@config_hash) : @config_structs rescue StandardError => e throw Services::Config::Errors::InvalidConfig.new(e.message, '#load_config') end end