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_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
- .model_base_classes=(val) ⇒ 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_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 @progress_bar 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
23 24 25 26 27 28 29 30 31 |
# File 'lib/active_mocker/config.rb', line 23 def load_defaults @error_verbosity = 1 @progress_bar = 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 |
.model_base_classes=(val) ⇒ Object
13 14 15 |
# File 'lib/active_mocker/config.rb', line 13 def model_base_classes=(val) @model_base_classes = val end |
.progress_class ⇒ Object
49 50 51 |
# File 'lib/active_mocker/config.rb', line 49 def progress_class @progress_bar ? Progress : NullProgress end |
.rails_defaults ⇒ Object
44 45 46 47 |
# File 'lib/active_mocker/config.rb', line 44 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
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/active_mocker/config.rb', line 33 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
18 19 20 21 |
# File 'lib/active_mocker/config.rb', line 18 def set load_defaults yield self end |