Class: PmdTester::DuplicationFileInfo
- Inherits:
-
Object
- Object
- PmdTester::DuplicationFileInfo
- Defined in:
- lib/pmdtester/parsers/cpd_report_document.rb
Overview
Represents a single file location of a duplication in a CPD report
Instance Attribute Summary collapse
-
#begintoken ⇒ Object
readonly
Returns the value of attribute begintoken.
-
#endtoken ⇒ Object
readonly
Returns the value of attribute endtoken.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(path:, location:, begintoken:, endtoken:) ⇒ DuplicationFileInfo
constructor
A new instance of DuplicationFileInfo.
Constructor Details
#initialize(path:, location:, begintoken:, endtoken:) ⇒ DuplicationFileInfo
Returns a new instance of DuplicationFileInfo.
221 222 223 224 225 226 |
# File 'lib/pmdtester/parsers/cpd_report_document.rb', line 221 def initialize(path:, location:, begintoken:, endtoken:) @path = path @location = location @begintoken = begintoken @endtoken = endtoken end |
Instance Attribute Details
#begintoken ⇒ Object (readonly)
Returns the value of attribute begintoken.
219 220 221 |
# File 'lib/pmdtester/parsers/cpd_report_document.rb', line 219 def begintoken @begintoken end |
#endtoken ⇒ Object (readonly)
Returns the value of attribute endtoken.
219 220 221 |
# File 'lib/pmdtester/parsers/cpd_report_document.rb', line 219 def endtoken @endtoken end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
219 220 221 |
# File 'lib/pmdtester/parsers/cpd_report_document.rb', line 219 def location @location end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
219 220 221 |
# File 'lib/pmdtester/parsers/cpd_report_document.rb', line 219 def path @path end |
Instance Method Details
#eql?(other) ⇒ Boolean
228 229 230 231 232 233 234 235 |
# File 'lib/pmdtester/parsers/cpd_report_document.rb', line 228 def eql?(other) return false unless other.is_a?(DuplicationFileInfo) path == other.path && location.eql?(other.location) && begintoken == other.begintoken && endtoken == other.endtoken end |
#hash ⇒ Object
237 238 239 |
# File 'lib/pmdtester/parsers/cpd_report_document.rb', line 237 def hash [path, location, begintoken, endtoken].hash end |