Class: Semverve::Finding

Inherits:
Object
  • Object
show all
Defined in:
lib/semverve/finding.rb

Overview

A version mismatch found by a Semverve check.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, line:, column:, version:, label: nil) ⇒ Semverve::Finding

Initializes a finding.

Parameters:



47
48
49
50
51
52
53
# File 'lib/semverve/finding.rb', line 47

def initialize(path:, line:, column:, version:, label: nil)
  @path = path
  @line = line
  @column = column
  @version = version
  @label = label
end

Instance Attribute Details

#columnInteger (readonly)

One-based column number.

Returns:

  • (Integer)


23
24
25
# File 'lib/semverve/finding.rb', line 23

def column
  @column
end

#labelString? (readonly)

Optional output label for findings that carry their own label.

Returns:

  • (String, nil)


35
36
37
# File 'lib/semverve/finding.rb', line 35

def label
  @label
end

#lineInteger (readonly)

One-based line number.

Returns:

  • (Integer)


17
18
19
# File 'lib/semverve/finding.rb', line 17

def line
  @line
end

#pathString (readonly)

Path relative to the configured project root.

Returns:

  • (String)


11
12
13
# File 'lib/semverve/finding.rb', line 11

def path
  @path
end

#versionSemverve::SemanticVersion (readonly)

Referenced semantic version.



29
30
31
# File 'lib/semverve/finding.rb', line 29

def version
  @version
end