Class: Lintress::Offense

Inherits:
Object
  • Object
show all
Defined in:
lib/lintress/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Offense

Returns a new instance of Offense.



35
36
37
38
39
40
# File 'lib/lintress/parser.rb', line 35

def initialize opts
  @ofile = opts[:file]
  @oline = opts[:line]
  @ocolumn = opts[:col]
  @oreason = opts[:reason]
end

Instance Attribute Details

#ocolumnObject

Returns the value of attribute ocolumn.



33
34
35
# File 'lib/lintress/parser.rb', line 33

def ocolumn
  @ocolumn
end

#ofileObject

Returns the value of attribute ofile.



33
34
35
# File 'lib/lintress/parser.rb', line 33

def ofile
  @ofile
end

#olineObject

Returns the value of attribute oline.



33
34
35
# File 'lib/lintress/parser.rb', line 33

def oline
  @oline
end

#oreasonObject

Returns the value of attribute oreason.



33
34
35
# File 'lib/lintress/parser.rb', line 33

def oreason
  @oreason
end

Instance Method Details

#to_sObject



42
43
44
# File 'lib/lintress/parser.rb', line 42

def to_s
  "#{ofile} at (#{oline}, #{ocolumn}) - #{oreason}"
end