Class: Pippi::Problem

Inherits:
Object
  • Object
show all
Defined in:
lib/pippi/problem.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_classObject

Returns the value of attribute check_class.



3
4
5
# File 'lib/pippi/problem.rb', line 3

def check_class
  @check_class
end

#file_pathObject

Returns the value of attribute file_path.



3
4
5
# File 'lib/pippi/problem.rb', line 3

def file_path
  @file_path
end

#line_numberObject

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?

Returns:

  • (Boolean)


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_sObject



23
24
25
# File 'lib/pippi/problem.rb', line 23

def to_s
  "#{file_path}:#{line_number},#{demodulized_check_class_name}"
end

#to_textObject

TODO probably need various reporting formats



12
13
14
# File 'lib/pippi/problem.rb', line 12

def to_text
  "#{file_path}:#{line_number},#{demodulized_check_class_name}"
end