Module: ActiveMocker::Config
Instance Attribute Summary collapse
-
#active_hash_as_base ⇒ Object
Returns the value of attribute active_hash_as_base.
-
#mass_assignment ⇒ Object
Returns the value of attribute mass_assignment.
-
#model_dir ⇒ Object
Returns the value of attribute model_dir.
-
#model_file_reader ⇒ Object
Returns the value of attribute model_file_reader.
-
#model_methods ⇒ Object
Returns the value of attribute model_methods.
-
#model_relationships ⇒ Object
Returns the value of attribute model_relationships.
-
#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
- #check_required_settings ⇒ Object
- #config {|_self| ... } ⇒ Object
- #log_level=(level) ⇒ Object
- #reload_default ⇒ Object
Instance Attribute Details
#active_hash_as_base ⇒ Object
Returns the value of attribute active_hash_as_base.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def active_hash_as_base @active_hash_as_base end |
#mass_assignment ⇒ Object
Returns the value of attribute mass_assignment.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def mass_assignment @mass_assignment 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 |
#model_methods ⇒ Object
Returns the value of attribute model_methods.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def model_methods @model_methods end |
#model_relationships ⇒ Object
Returns the value of attribute model_relationships.
6 7 8 |
# File 'lib/active_mocker/config.rb', line 6 def model_relationships @model_relationships 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
33 34 35 36 |
# File 'lib/active_mocker/config.rb', line 33 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
16 17 18 19 20 |
# File 'lib/active_mocker/config.rb', line 16 def config @@first_load ||= reload_default yield self check_required_settings end |
#log_level=(level) ⇒ Object
38 39 40 |
# File 'lib/active_mocker/config.rb', line 38 def log_level=(level) Logger_.level = level end |
#reload_default ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/active_mocker/config.rb', line 22 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 |