Class: Pippi::Problem
- Inherits:
-
Object
- Object
- Pippi::Problem
- Defined in:
- lib/pippi/problem.rb
Instance Attribute Summary collapse
-
#check_class ⇒ Object
Returns the value of attribute check_class.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#line_number ⇒ Object
Returns the value of attribute line_number.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
TODO correct method?.
-
#initialize(opts) ⇒ Problem
constructor
A new instance of Problem.
- #to_s ⇒ Object
-
#to_text ⇒ Object
TODO probably need various reporting formats.
Constructor Details
#initialize(opts) ⇒ Problem
Returns a new instance of Problem.
5 6 7 8 9 |
# File 'lib/pippi/problem.rb', line 5 def initialize(opts) @file_path = opts[:file_path] @check_class = opts[:check_class] @line_number = opts[:line_number] end |
Instance Attribute Details
#check_class ⇒ Object
Returns the value of attribute check_class.
3 4 5 |
# File 'lib/pippi/problem.rb', line 3 def check_class @check_class end |
#file_path ⇒ Object
Returns the value of attribute file_path.
3 4 5 |
# File 'lib/pippi/problem.rb', line 3 def file_path @file_path end |
#line_number ⇒ Object
Returns the value of attribute line_number.
3 4 5 |
# File 'lib/pippi/problem.rb', line 3 def line_number @line_number end |
Instance Method Details
#eql?(other) ⇒ Boolean
TODO correct method?
17 18 19 20 21 |
# File 'lib/pippi/problem.rb', line 17 def eql?(other) file_path == other.file_path && check_class == other.check_class && line_number == other.line_number end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/pippi/problem.rb', line 23 def to_s "#{file_path},#{check_class.name.split('::').last},#{line_number}" end |
#to_text ⇒ Object
TODO probably need various reporting formats
12 13 14 |
# File 'lib/pippi/problem.rb', line 12 def to_text "#{file_path},#{check_class.name.split('::').last},#{line_number}" end |