Class: ArchUnit::Metrics::Extraction::ClassInfo
- Inherits:
-
Data
- Object
- Data
- ArchUnit::Metrics::Extraction::ClassInfo
- Defined in:
- lib/archunit/metrics/extraction/metric_info.rb
Overview
Static information about one Ruby class declaration.
rubocop:disable Lint/DataDefineOverride -- methods is the established metric vocabulary.
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(name:, file_path:, methods: [], fields: []) ⇒ ClassInfo
constructor
A new instance of ClassInfo.
Constructor Details
#initialize(name:, file_path:, methods: [], fields: []) ⇒ ClassInfo
Returns a new instance of ClassInfo.
77 78 79 80 81 82 83 |
# File 'lib/archunit/metrics/extraction/metric_info.rb', line 77 def initialize(name:, file_path:, methods: [], fields: []) name = immutable_string(name, :name) file_path = immutable_string(file_path, :file_path, normalize_path: true) methods = immutable_values(methods, MethodInfo, :methods) fields = immutable_values(fields, FieldInfo, :fields) super end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields
74 75 76 |
# File 'lib/archunit/metrics/extraction/metric_info.rb', line 74 def fields @fields end |
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path
74 75 76 |
# File 'lib/archunit/metrics/extraction/metric_info.rb', line 74 def file_path @file_path end |
#methods ⇒ Object (readonly)
Returns the value of attribute methods
74 75 76 |
# File 'lib/archunit/metrics/extraction/metric_info.rb', line 74 def methods @methods end |
#name ⇒ Object (readonly)
Returns the value of attribute name
74 75 76 |
# File 'lib/archunit/metrics/extraction/metric_info.rb', line 74 def name @name end |
Instance Method Details
#identifier ⇒ Object
85 86 87 |
# File 'lib/archunit/metrics/extraction/metric_info.rb', line 85 def identifier "#{file_path}:#{name}" end |