Class: ArchUnit::Slices::FluentApi::ForbiddenSliceDependencyCondition

Inherits:
Object
  • Object
show all
Includes:
Common::FluentApi::Checkable
Defined in:
lib/archunit/slices/fluentapi/forbidden_slice_dependency_condition.rb

Overview

Executable slices should not contain dependency rule.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Common::FluentApi::Checkable

#check

Constructor Details

#initialize(scope, source_slice:, target_slice:) ⇒ ForbiddenSliceDependencyCondition

Returns a new instance of ForbiddenSliceDependencyCondition.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/archunit/slices/fluentapi/forbidden_slice_dependency_condition.rb', line 17

def initialize(scope, source_slice:, target_slice:)
  unless scope.is_a?(SliceScopeBuilder)
    raise ArgumentError, 'scope must be a SliceScopeBuilder'
  end

  @scope = scope
  @project_locator = scope.project_locator
  @projection = scope.projection
  @source_slice = immutable_slice_name(source_slice, :source_slice)
  @target_slice = immutable_slice_name(target_slice, :target_slice)
  freeze
end

Instance Attribute Details

#project_locatorObject (readonly)

Returns the value of attribute project_locator.



15
16
17
# File 'lib/archunit/slices/fluentapi/forbidden_slice_dependency_condition.rb', line 15

def project_locator
  @project_locator
end

#projectionObject (readonly)

Returns the value of attribute projection.



15
16
17
# File 'lib/archunit/slices/fluentapi/forbidden_slice_dependency_condition.rb', line 15

def projection
  @projection
end

#scopeObject (readonly)

Returns the value of attribute scope.



15
16
17
# File 'lib/archunit/slices/fluentapi/forbidden_slice_dependency_condition.rb', line 15

def scope
  @scope
end

#source_sliceObject (readonly)

Returns the value of attribute source_slice.



15
16
17
# File 'lib/archunit/slices/fluentapi/forbidden_slice_dependency_condition.rb', line 15

def source_slice
  @source_slice
end

#target_sliceObject (readonly)

Returns the value of attribute target_slice.



15
16
17
# File 'lib/archunit/slices/fluentapi/forbidden_slice_dependency_condition.rb', line 15

def target_slice
  @target_slice
end

Instance Method Details

#negated?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/archunit/slices/fluentapi/forbidden_slice_dependency_condition.rb', line 30

def negated?
  true
end