Sha256: d839d232cbc9d809b03d90d40570c5f5a09dcf49283dc35a11a376317a7425dc
Contents?: true
Size: 746 Bytes
Versions: 20
Compression:
Stored size: 746 Bytes
Contents
module Brillo # Responsible for asserting that the config file is valid class Scrubber include Common attr_reader :config def initialize(config) parse_config(config) end def validate errors = Hash.new({}.freeze) klass_association_map.each do |klass, options| begin real_klass = deserialize_class(klass) rescue errors[klass][:name] = "No such class #{klass.camelize}, did you use the singular?" end begin tactic = options.fetch("tactic").to_sym rescue KeyError errors[klass][:tactic] "Tactic not specified" end end end def deserialize_class(klass) klass.camelize.constantize end end end
Version data entries
20 entries across 20 versions & 1 rubygems