Module: ActiveMocker::Config
Instance Attribute Summary collapse
-
#clear_cache ⇒ Object
Returns the value of attribute clear_cache.
-
#model_attributes ⇒ Object
Returns the value of attribute model_attributes.
-
#model_dir ⇒ Object
Returns the value of attribute model_dir.
-
#model_file_reader ⇒ Object
Returns the value of attribute model_file_reader.
-
#schema_attributes ⇒ Object
Returns the value of attribute schema_attributes.
-
#schema_file ⇒ Object
Returns the value of attribute schema_file.
-
#schema_file_reader ⇒ Object
Returns the value of attribute schema_file_reader.
Instance Method Summary collapse
- #active_hash_as_base=(arg) ⇒ Object
- #check_required_settings ⇒ Object
- #config {|_self| ... } ⇒ Object
- #log_level=(level) ⇒ Object
- #mass_assignment=(arg) ⇒ Object
- #model_methods=(arg) ⇒ Object
- #model_relationships=(arg) ⇒ Object
- #reload_default ⇒ Object
- #require_active_hash ⇒ Object
Instance Attribute Details
#clear_cache ⇒ Object
Returns the value of attribute clear_cache.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def clear_cache @clear_cache end |
#model_attributes ⇒ Object
Returns the value of attribute model_attributes.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def model_attributes @model_attributes end |
#model_dir ⇒ Object
Returns the value of attribute model_dir.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def model_dir @model_dir end |
#model_file_reader ⇒ Object
Returns the value of attribute model_file_reader.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def model_file_reader @model_file_reader end |
#schema_attributes ⇒ Object
Returns the value of attribute schema_attributes.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def schema_attributes @schema_attributes end |
#schema_file ⇒ Object
Returns the value of attribute schema_file.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def schema_file @schema_file end |
#schema_file_reader ⇒ Object
Returns the value of attribute schema_file_reader.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def schema_file_reader @schema_file_reader end |
Instance Method Details
#active_hash_as_base=(arg) ⇒ Object
45 46 47 |
# File 'lib/active_mocker/config.rb', line 45 def active_hash_as_base=(arg) Logger_.warn('Deprecation Warning: config option `active_hash_as_base` is now model_attributes') end |
#check_required_settings ⇒ Object
32 33 34 35 |
# File 'lib/active_mocker/config.rb', line 32 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 |
#config {|_self| ... } ⇒ Object
14 15 16 17 18 19 |
# File 'lib/active_mocker/config.rb', line 14 def config @@first_load ||= reload_default yield self check_required_settings require_active_hash end |
#log_level=(level) ⇒ Object
41 42 43 |
# File 'lib/active_mocker/config.rb', line 41 def log_level=(level) Logger_.level = level end |
#mass_assignment=(arg) ⇒ Object
57 58 59 |
# File 'lib/active_mocker/config.rb', line 57 def mass_assignment=(arg) Logger_.warn('Deprecation Warning: config option `mass_assignment` is now model_attributes') end |
#model_methods=(arg) ⇒ Object
53 54 55 |
# File 'lib/active_mocker/config.rb', line 53 def model_methods=(arg) Logger_.warn('Deprecation Warning: config option `model_methods` is now model_attributes') end |
#model_relationships=(arg) ⇒ Object
49 50 51 |
# File 'lib/active_mocker/config.rb', line 49 def model_relationships=(arg) Logger_.warn('Deprecation Warning: config option `model_relationships` is now model_attributes') end |
#reload_default ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/active_mocker/config.rb', line 21 def reload_default @log_level = Logger::WARN @schema_file = nil @model_dir = nil @schema_attributes = true @model_attributes = true @clear_cache = false @schema_file_reader = nil @model_file_reader = nil end |
#require_active_hash ⇒ Object
37 38 39 |
# File 'lib/active_mocker/config.rb', line 37 def require_active_hash require 'active_hash' if schema_attributes end |