Class: AdLint::Postfilter::LineWiseSuppression

Inherits:
MessageWiseSuppression show all
Includes:
Deactivatable
Defined in:
lib/adlint/postfilter/suppress.rb

Instance Attribute Summary collapse

Attributes included from Deactivatable

#active

Attributes inherited from MessageWiseSuppression

#message_id

Instance Method Summary collapse

Methods included from Deactivatable

#active?

Constructor Details

#initialize(message_id, fpath, line_no, active) ⇒ LineWiseSuppression

Returns a new instance of LineWiseSuppression.



108
109
110
111
112
# File 'lib/adlint/postfilter/suppress.rb', line 108

def initialize(message_id, fpath, line_no, active)
  super(message_id)
  @fpath, @line_no = fpath, line_no
  self.active = active
end

Instance Attribute Details

#fpathObject (readonly)

Returns the value of attribute fpath.



114
115
116
# File 'lib/adlint/postfilter/suppress.rb', line 114

def fpath
  @fpath
end

#line_noObject (readonly)

Returns the value of attribute line_no.



115
116
117
# File 'lib/adlint/postfilter/suppress.rb', line 115

def line_no
  @line_no
end

Instance Method Details

#_match_with?(message_line) ⇒ Boolean

Returns:

  • (Boolean)


117
118
119
120
121
122
123
124
# File 'lib/adlint/postfilter/suppress.rb', line 117

def _match_with?(message_line)
  if self.active?
    super &&
      message_line.fpath == @fpath && message_line.line_no == @line_no
  else
    false
  end
end