Class: ArchUnit::Common::Extraction::DependencyEvidence

Inherits:
Data
  • Object
show all
Defined in:
lib/archunit/common/extraction/dependency_evidence.rb

Overview

Source-level support for a file dependency, without implying runtime execution.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source:, kind:, name:, line_number:, end_line: line_number, target_line_number: nil) ⇒ DependencyEvidence

Keywords mirror this immutable source span.



13
14
15
16
17
18
19
20
21
# File 'lib/archunit/common/extraction/dependency_evidence.rb', line 13

def initialize( # rubocop:disable Metrics/ParameterLists
  source:, kind:, name:, line_number:, end_line: line_number, target_line_number: nil
)
  validate_identity(source, kind, name)
  validate_lines(line_number, end_line, target_line_number)
  source = source.tr('\\', '/').freeze
  name = name.dup.freeze
  super
end

Instance Attribute Details

#end_line ⇒ Object (readonly)

Returns the value of attribute end_line

Returns:

  • (Object) —

    the current value of end_line



9
10
11
# File 'lib/archunit/common/extraction/dependency_evidence.rb', line 9

def end_line
  @end_line
end

#kind ⇒ Object (readonly)

Returns the value of attribute kind

Returns:

  • (Object) —

    the current value of kind



9
10
11
# File 'lib/archunit/common/extraction/dependency_evidence.rb', line 9

def kind
  @kind
end

#line_number ⇒ Object (readonly)

Returns the value of attribute line_number

Returns:

  • (Object) —

    the current value of line_number



9
10
11
# File 'lib/archunit/common/extraction/dependency_evidence.rb', line 9

def line_number
  @line_number
end

#name ⇒ Object (readonly)

Returns the value of attribute name

Returns:

  • (Object) —

    the current value of name



9
10
11
# File 'lib/archunit/common/extraction/dependency_evidence.rb', line 9

def name
  @name
end

#source ⇒ Object (readonly)

Returns the value of attribute source

Returns:

  • (Object) —

    the current value of source



9
10
11
# File 'lib/archunit/common/extraction/dependency_evidence.rb', line 9

def source
  @source
end

#target_line_number ⇒ Object (readonly)

Returns the value of attribute target_line_number

Returns:

  • (Object) —

    the current value of target_line_number



9
10
11
# File 'lib/archunit/common/extraction/dependency_evidence.rb', line 9

def target_line_number
  @target_line_number
end