Sha256: d2a5005438d20e987ae6ad763a84b45e1e8809fb8358c3c835d7c7c6563c41d2
Contents?: true
Size: 711 Bytes
Versions: 28
Compression:
Stored size: 711 Bytes
Contents
class Eye::Patch::Config < Hash def initialize(settings) super() self.merge!(parse(settings)) end private def parse(settings) return @config if @config @config = {} parse_config(settings) parse_contacts(settings) @config end def parse_config(settings) @config.merge!(settings[:config] || {}) end def parse_contacts(settings) @config[:contacts] = {} Array(settings[:notifications]).each do |notify| @config[notify[:type].to_sym] = notify[:config] @config[:contacts][notify[:name].to_s] = { name: notify[:name].to_s, type: notify[:type].to_sym, contact: notify[:contact].to_s, opts: {} } end end end
Version data entries
28 entries across 28 versions & 1 rubygems