vulture/lib/config.rb

21 lines
264 B
Ruby
Raw Permalink Normal View History

2022-12-07 15:39:48 -05:00
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