Initial ruby project structure

This commit is contained in:
2022-12-07 15:39:48 -05:00
parent f69b5d587a
commit ae443a5ba3
4 changed files with 44 additions and 1 deletions

20
lib/config.rb Normal file
View File

@ -0,0 +1,20 @@
require 'yaml'
class Config
def initialize(config_path)
@data = YAML::load_file(config_path)
end
def get(key, depth = 0)
bits = key.split('.')
value = @data
bits.each do |bit|
value = value[bit]
end
return value
end
end