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