Class: ArchUnit::Metrics::FluentApi::ZoneCondition
- Inherits:
-
Object
- Object
- ArchUnit::Metrics::FluentApi::ZoneCondition
- Includes:
- Common::FluentApi::Checkable
- Defined in:
- lib/archunit/metrics/fluentapi/zone_condition.rb
Overview
Executable guard that rejects files in one architectural distance zone.
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#zone ⇒ Object
readonly
Returns the value of attribute zone.
Instance Method Summary collapse
-
#initialize(scope:, zone:) ⇒ ZoneCondition
constructor
A new instance of ZoneCondition.
Methods included from Common::FluentApi::Checkable
Constructor Details
#initialize(scope:, zone:) ⇒ ZoneCondition
Returns a new instance of ZoneCondition.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/archunit/metrics/fluentapi/zone_condition.rb', line 15 def initialize(scope:, zone:) raise ArgumentError, 'scope must be a MetricsBuilder' unless scope.is_a?(MetricsBuilder) unless Assertion::MetricZoneViolation::ZONES.include?(zone) raise ArgumentError, "unknown architectural zone: #{zone.inspect}" end @scope = scope @zone = zone freeze end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
13 14 15 |
# File 'lib/archunit/metrics/fluentapi/zone_condition.rb', line 13 def scope @scope end |
#zone ⇒ Object (readonly)
Returns the value of attribute zone.
13 14 15 |
# File 'lib/archunit/metrics/fluentapi/zone_condition.rb', line 13 def zone @zone end |