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.
-
#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) ⇒ CheckOptions
constructor
A new instance of CheckOptions.
Constructor Details
#initialize(allow_empty_tests: false, logging: nil, clear_cache: false) ⇒ CheckOptions
Returns a new instance of CheckOptions.
17 18 19 20 21 22 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 17 def initialize(allow_empty_tests: false, logging: nil, clear_cache: false) validate_boolean(allow_empty_tests, :allow_empty_tests) validate_logging(logging) validate_boolean(clear_cache, :clear_cache) 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 |
#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
24 25 26 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 24 def allow_empty_tests? allow_empty_tests end |
#clear_cache? ⇒ Boolean
28 29 30 |
# File 'lib/archunit/common/fluentapi/check_options.rb', line 28 def clear_cache? clear_cache end |