Class: Punchlist::Offense

Inherits:
Object
  • Object
show all
Defined in:
lib/punchlist/offense.rb

Overview

Represents a discovered punchlist item in code

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, line_num, line) ⇒ Offense

Returns a new instance of Offense.



7
8
9
10
11
# File 'lib/punchlist/offense.rb', line 7

def initialize(filename, line_num, line)
  @filename = filename
  @line_num = line_num
  @line = line
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



6
7
8
# File 'lib/punchlist/offense.rb', line 6

def filename
  @filename
end

#lineObject (readonly)

Returns the value of attribute line.



6
7
8
# File 'lib/punchlist/offense.rb', line 6

def line
  @line
end

#line_numObject (readonly)

Returns the value of attribute line_num.



6
7
8
# File 'lib/punchlist/offense.rb', line 6

def line_num
  @line_num
end

Instance Method Details

#==(other) ⇒ Object



13
14
15
# File 'lib/punchlist/offense.rb', line 13

def ==(other)
  other.class == self.class && other.state == state
end