Sha256: 0ea1906d10a4d20ad71359f9ef2956265bdf3e78f038a32d24e3596e8342c567
Contents?: true
Size: 1.14 KB
Versions: 9
Compression:
Stored size: 1.14 KB
Contents
module ActiveMocker module Config extend self attr_accessor :schema_file, :model_dir, :active_hash_as_base, :schema_attributes, :model_relationships, :model_methods, :mass_assignment, :schema_file_reader, :model_file_reader def config @@first_load ||= reload_default yield self check_required_settings end def reload_default @schema_file = nil @model_dir = nil @active_hash_as_base = false @schema_attributes = true @model_relationships = true @model_methods = true @mass_assignment = true @log_level = Logger::WARN end def check_required_settings raise 'schema_file must be specified'if schema_file.nil? raise 'model_dir must be specified'if model_dir.nil? end def log_level=(level) Logger_.level = level end def active_hash_as_base=(bool) if bool require 'active_hash' end @active_hash_as_base = bool end end end
Version data entries
9 entries across 9 versions & 1 rubygems