Class: ActiveMocker::Config
- Inherits:
-
Object
- Object
- ActiveMocker::Config
- Defined in:
- lib/active_mocker/config.rb
Class Attribute Summary collapse
-
.disable_modules_and_constants ⇒ Object
Returns the value of attribute disable_modules_and_constants.
-
.error_verbosity ⇒ Object
Returns the value of attribute error_verbosity.
-
.mock_append_name ⇒ Object
Returns the value of attribute mock_append_name.
-
.mock_dir ⇒ Object
Returns the value of attribute mock_dir.
-
.model_base_classes ⇒ Object
writeonly
Sets the attribute model_base_classes.
-
.model_dir ⇒ Object
Returns the value of attribute model_dir.
-
.progress_bar ⇒ Object
Returns the value of attribute progress_bar.
-
.single_model_path ⇒ Object
Returns the value of attribute single_model_path.
Class Method Summary collapse
- .load_defaults ⇒ Object
- .progress_class ⇒ Object
- .rails_defaults ⇒ Object
- .reset_all ⇒ Object
- .set {|_self| ... } ⇒ Object
Class Attribute Details
.disable_modules_and_constants ⇒ Object
Returns the value of attribute disable_modules_and_constants.
5 6 7 |
# File 'lib/active_mocker/config.rb', line 5 def disable_modules_and_constants @disable_modules_and_constants end |
.error_verbosity ⇒ Object
Returns the value of attribute error_verbosity.
5 6 7 |
# File 'lib/active_mocker/config.rb', line 5 def error_verbosity @error_verbosity end |
.mock_append_name ⇒ Object
Returns the value of attribute mock_append_name.
5 6 7 |
# File 'lib/active_mocker/config.rb', line 5 def mock_append_name @mock_append_name end |
.mock_dir ⇒ Object
Returns the value of attribute mock_dir.
5 6 7 |
# File 'lib/active_mocker/config.rb', line 5 def mock_dir @mock_dir end |
.model_base_classes=(value) ⇒ Object (writeonly)
Sets the attribute model_base_classes
13 14 15 |
# File 'lib/active_mocker/config.rb', line 13 def model_base_classes=(value) @model_base_classes = value end |
.model_dir ⇒ Object
Returns the value of attribute model_dir.
5 6 7 |
# File 'lib/active_mocker/config.rb', line 5 def model_dir @model_dir end |
.progress_bar ⇒ Object
Returns the value of attribute progress_bar.
5 6 7 |
# File 'lib/active_mocker/config.rb', line 5 def end |
.single_model_path ⇒ Object
Returns the value of attribute single_model_path.
5 6 7 |
# File 'lib/active_mocker/config.rb', line 5 def single_model_path @single_model_path end |
Class Method Details
.load_defaults ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/active_mocker/config.rb', line 21 def load_defaults @error_verbosity = 1 = true @disable_modules_and_constants = false @model_dir = nil unless @model_dir @mock_dir = nil unless @mock_dir @mock_append_name = "Mock" rails_defaults if Object.const_defined?("Rails") end |
.progress_class ⇒ Object
47 48 49 |
# File 'lib/active_mocker/config.rb', line 47 def progress_class ? Progress : NullProgress end |
.rails_defaults ⇒ Object
42 43 44 45 |
# File 'lib/active_mocker/config.rb', line 42 def rails_defaults @model_dir = File.join(Rails.root, "app/models") unless @model_dir @mock_dir = File.join(Rails.root, "spec/mocks") unless @mock_dir end |
.reset_all ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/active_mocker/config.rb', line 31 def reset_all [:model_dir, :mock_dir, :log_location, :single_model_path, :progress_bar, :error_verbosity, :mock_append_name, ].each { |ivar| instance_variable_set("@#{ivar}", nil) } end |
.set {|_self| ... } ⇒ Object
16 17 18 19 |
# File 'lib/active_mocker/config.rb', line 16 def set load_defaults yield self end |