Class: ArchUnit::Files::Extraction::FileInfo
- Inherits:
-
Data
- Object
- Data
- ArchUnit::Files::Extraction::FileInfo
- Defined in:
- lib/archunit/files/extraction/file_info.rb
Overview
Immutable source-file information exposed to custom predicates.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#extension ⇒ Object
readonly
Returns the value of attribute extension.
-
#lines_of_code ⇒ Object
readonly
Returns the value of attribute lines_of_code.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path:, name:, extension:, directory:, content:, lines_of_code:) ⇒ FileInfo
constructor
rubocop:disable Metrics/ParameterLists -- FileInfo has six required public fields.
Constructor Details
#initialize(path:, name:, extension:, directory:, content:, lines_of_code:) ⇒ FileInfo
rubocop:disable Metrics/ParameterLists -- FileInfo has six required public fields.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/archunit/files/extraction/file_info.rb', line 12 def initialize(path:, name:, extension:, directory:, content:, lines_of_code:) path = immutable_string(path, :path, allow_empty: false, normalize_path: true) name = immutable_string(name, :name, allow_empty: false) extension = immutable_string(extension, :extension, allow_empty: true) directory = immutable_string( directory, :directory, allow_empty: true, normalize_path: true ) content = immutable_string(content, :content, allow_empty: true) lines_of_code = non_negative_integer(lines_of_code) super end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content
8 9 10 |
# File 'lib/archunit/files/extraction/file_info.rb', line 8 def content @content end |
#directory ⇒ Object (readonly)
Returns the value of attribute directory
8 9 10 |
# File 'lib/archunit/files/extraction/file_info.rb', line 8 def directory @directory end |
#extension ⇒ Object (readonly)
Returns the value of attribute extension
8 9 10 |
# File 'lib/archunit/files/extraction/file_info.rb', line 8 def extension @extension end |
#lines_of_code ⇒ Object (readonly)
Returns the value of attribute lines_of_code
8 9 10 |
# File 'lib/archunit/files/extraction/file_info.rb', line 8 def lines_of_code @lines_of_code end |
#name ⇒ Object (readonly)
Returns the value of attribute name
8 9 10 |
# File 'lib/archunit/files/extraction/file_info.rb', line 8 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path
8 9 10 |
# File 'lib/archunit/files/extraction/file_info.rb', line 8 def path @path end |