Class: ArchUnit::Metrics::Extraction::ProjectInfo
- Inherits:
-
Data
- Object
- Data
- ArchUnit::Metrics::Extraction::ProjectInfo
- Defined in:
- lib/archunit/metrics/extraction/metric_info.rb
Overview
Complete immutable metric input for one located Ruby project.
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#project_root ⇒ Object
readonly
Returns the value of attribute project_root.
Instance Method Summary collapse
- #classes ⇒ Object
-
#initialize(project_root:, files: []) ⇒ ProjectInfo
constructor
A new instance of ProjectInfo.
Constructor Details
#initialize(project_root:, files: []) ⇒ ProjectInfo
Returns a new instance of ProjectInfo.
145 146 147 148 149 150 151 |
# File 'lib/archunit/metrics/extraction/metric_info.rb', line 145 def initialize(project_root:, files: []) project_root = immutable_string( project_root, :project_root, normalize_path: true ) files = immutable_values(files, FileInfo, :files) super end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files
142 143 144 |
# File 'lib/archunit/metrics/extraction/metric_info.rb', line 142 def files @files end |
#project_root ⇒ Object (readonly)
Returns the value of attribute project_root
142 143 144 |
# File 'lib/archunit/metrics/extraction/metric_info.rb', line 142 def project_root @project_root end |
Instance Method Details
#classes ⇒ Object
153 154 155 |
# File 'lib/archunit/metrics/extraction/metric_info.rb', line 153 def classes files.flat_map(&:class_infos).freeze end |