Module: ActiveMocker::Config
Instance Attribute Summary collapse
-
#clear_cache ⇒ Object
Returns the value of attribute clear_cache.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#migration_dir ⇒ Object
Returns the value of attribute migration_dir.
-
#mock_dir ⇒ Object
Returns the value of attribute mock_dir.
-
#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
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 |
#log_level ⇒ Object
Returns the value of attribute log_level.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def log_level @log_level end |
#logger ⇒ Object
Returns the value of attribute logger.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def logger @logger end |
#migration_dir ⇒ Object
Returns the value of attribute migration_dir.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def migration_dir @migration_dir end |
#mock_dir ⇒ Object
Returns the value of attribute mock_dir.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def mock_dir @mock_dir 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
#check_required_settings ⇒ Object
37 38 39 40 41 |
# File 'lib/active_mocker/config.rb', line 37 def check_required_settings raise 'schema_file must be specified' if schema_file.nil? raise 'model_dir must be specified' if model_dir.nil? raise 'mock_dir must be specified' if mock_dir.nil? end |
#config {|_self| ... } ⇒ Object
18 19 20 21 22 |
# File 'lib/active_mocker/config.rb', line 18 def config @@first_load ||= reload_default yield self check_required_settings end |
#reload_default ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/active_mocker/config.rb', line 24 def reload_default @schema_file = nil @model_dir = nil @schema_attributes = true @model_attributes = true @clear_cache = false @schema_file_reader = nil @model_file_reader = nil @migration_dir = nil @mock_dir = nil @logger = ::Logger.new(STDOUT) end |