Sha256: e63f9319ca78dc2b50c51da33438607d9c531624be8583149e5a116bfcf4bd51
Contents?: true
Size: 651 Bytes
Versions: 7
Compression:
Stored size: 651 Bytes
Contents
# frozen_string_literal: true module SlackMessaging class Config class << self def method_missing(method, args = false) config_data.send(method, args) end def load(path) load_config(path) config end private def config config_data.to_hash end private def config_data @config_data ||= Hashie::Mash.new end private def load_config(file) raise StandardError, "Missing configuration file: #{file}" unless File.exist?(file) YAML.load_file(file).each { |key, value| config_data.assign_property(key, value) } end end end end
Version data entries
7 entries across 7 versions & 1 rubygems