Class: DontComment::Offense

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#locObject

Returns the value of attribute loc

Returns:

  • (Object)

    the current value of loc



2
3
4
# File 'lib/dont_comment/offense.rb', line 2

def loc
  @loc
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



2
3
4
# File 'lib/dont_comment/offense.rb', line 2

def path
  @path
end

Instance Method Details

#relative_pathObject



3
4
5
6
7
# File 'lib/dont_comment/offense.rb', line 3

def relative_path
  pwd = Pathname.pwd
  absolute_path = pwd.join(path)
  absolute_path.relative_path_from(pwd)
end