Class: ArchUnit::Common::FluentApi::CheckOptions
- Inherits:
-
Data
- Object
- Data
- ArchUnit::Common::FluentApi::CheckOptions
- Defined in:
- lib/archunit/common/fluentapi/check_options.rb
Overview
Immutable options shared by every terminal rule check.
Instance Attribute Summary collapse
-
#allow_empty_tests ⇒ Object
readonly
Returns the value of attribute allow_empty_tests.
-
#clear_cache ⇒ Object
readonly
Returns the value of attribute clear_cache.
-
#load_paths ⇒ Object
readonly
Returns the value of attribute load_paths.
-
#logging ⇒ Object
readonly
Returns the value of attribute logging.
Class Method Summary collapse
Instance Method Summary collapse
-
#allow_empty_tests? ⇒ Boolean
-
#clear_cache? ⇒ Boolean
-
#initialize(allow_empty_tests: false, logging: nil, clear_cache: false, load_paths: []) ⇒ CheckOptions
constructor
A new instance of CheckOptions.
Constructor Details
#initialize(allow_empty_tests: false, logging: nil, clear_cache: false, load_paths: []) ⇒ CheckOptions
Returns a new instance of CheckOptions.
17 18 19 20 21 22 23 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 17 def initialize(allow_empty_tests: false, logging: nil, clear_cache: false, load_paths: []) validate_boolean(allow_empty_tests, :allow_empty_tests) validate_logging(logging) validate_boolean(clear_cache, :clear_cache) load_paths = immutable_load_paths(load_paths) super end |
Instance Attribute Details
#allow_empty_tests ⇒ Object (readonly)
Returns the value of attribute allow_empty_tests
9 10 11 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 9 def allow_empty_tests @allow_empty_tests end |
#clear_cache ⇒ Object (readonly)
Returns the value of attribute clear_cache
9 10 11 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 9 def clear_cache @clear_cache end |
#load_paths ⇒ Object (readonly)
Returns the value of attribute load_paths
9 10 11 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 9 def load_paths @load_paths end |
#logging ⇒ Object (readonly)
Returns the value of attribute logging
9 10 11 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 9 def logging @logging end |
Class Method Details
.resolve(value) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 10 def self.resolve(value) return new if value.nil? return value if value.is_a?(self) raise ArgumentError, 'options must be a CheckOptions value or nil' end |
Instance Method Details
#allow_empty_tests? ⇒ Boolean
25 26 27 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 25 def allow_empty_tests? allow_empty_tests end |
#clear_cache? ⇒ Boolean
29 30 31 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 29 def clear_cache? clear_cache end |