Class: Goodcheck::Issue
- Inherits:
-
Object
- Object
- Goodcheck::Issue
- Defined in:
- lib/goodcheck/issue.rb
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
-
#range ⇒ Object
readonly
Returns the value of attribute range.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(buffer:, range:, rule:, text:) ⇒ Issue
constructor
A new instance of Issue.
- #location ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(buffer:, range:, rule:, text:) ⇒ Issue
Returns a new instance of Issue.
8 9 10 11 12 13 |
# File 'lib/goodcheck/issue.rb', line 8 def initialize(buffer:, range:, rule:, text:) @buffer = buffer @range = range @rule = rule @text = text end |
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
3 4 5 |
# File 'lib/goodcheck/issue.rb', line 3 def buffer @buffer end |
#range ⇒ Object (readonly)
Returns the value of attribute range.
4 5 6 |
# File 'lib/goodcheck/issue.rb', line 4 def range @range end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
5 6 7 |
# File 'lib/goodcheck/issue.rb', line 5 def rule @rule end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/goodcheck/issue.rb', line 6 def text @text end |
Instance Method Details
#location ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/goodcheck/issue.rb', line 19 def location unless @location start_line, start_column = buffer.location_for_position(range.begin) end_line, end_column = buffer.location_for_position(range.end) @location = Location.new(start_line: start_line, start_column: start_column, end_line: end_line, end_column: end_column) end @location end |
#path ⇒ Object
15 16 17 |
# File 'lib/goodcheck/issue.rb', line 15 def path buffer.path end |