Class: ArchUnit::Extraction::ResolvedImport

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(module_name:, import_kind:, line_number:, resolved_path: nil) ⇒ ResolvedImport

Returns a new instance of ResolvedImport.



8
9
10
11
12
13
14
15
16
17
# File 'lib/archunit/extraction/resolved_import.rb', line 8

def initialize(module_name:, import_kind:, line_number:, resolved_path: nil)
  validate_module_name(module_name)
  validate_import_kind(import_kind)
  validate_line_number(line_number)
  validate_resolved_path(resolved_path)

  module_name = module_name.dup.freeze
  resolved_path = resolved_path&.tr('\\', '/')&.freeze
  super
end

Instance Attribute Details

#import_kindObject (readonly)

Returns the value of attribute import_kind

Returns:

  • (Object)

    the current value of import_kind



7
8
9
# File 'lib/archunit/extraction/resolved_import.rb', line 7

def import_kind
  @import_kind
end

#line_numberObject (readonly)

Returns the value of attribute line_number

Returns:

  • (Object)

    the current value of line_number



7
8
9
# File 'lib/archunit/extraction/resolved_import.rb', line 7

def line_number
  @line_number
end

#module_nameObject (readonly)

Returns the value of attribute module_name

Returns:

  • (Object)

    the current value of module_name



7
8
9
# File 'lib/archunit/extraction/resolved_import.rb', line 7

def module_name
  @module_name
end

#resolved_pathObject (readonly)

Returns the value of attribute resolved_path

Returns:

  • (Object)

    the current value of resolved_path



7
8
9
# File 'lib/archunit/extraction/resolved_import.rb', line 7

def resolved_path
  @resolved_path
end