Class: AdLint::Postfilter::MessageLine

Inherits:
Line
  • Object
show all
Defined in:
lib/adlint/postfilter/content.rb

Direct Known Subclasses

CsvMessageLine, PlainMessageLine

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str, fpath_str, line_no_str, message_id_str) ⇒ MessageLine

Returns a new instance of MessageLine.



93
94
95
96
97
98
99
# File 'lib/adlint/postfilter/content.rb', line 93

def initialize(str, fpath_str, line_no_str, message_id_str)
  super(str)

  @fpath = Pathname.new(fpath_str).realpath
  @line_no = line_no_str ? line_no_str.to_i : nil
  @message_id = message_id_str.to_sym
end

Instance Attribute Details

#fpathObject (readonly)

Returns the value of attribute fpath.



101
102
103
# File 'lib/adlint/postfilter/content.rb', line 101

def fpath
  @fpath
end

#line_noObject (readonly)

Returns the value of attribute line_no.



102
103
104
# File 'lib/adlint/postfilter/content.rb', line 102

def line_no
  @line_no
end

#message_idObject (readonly)

Returns the value of attribute message_id.



103
104
105
# File 'lib/adlint/postfilter/content.rb', line 103

def message_id
  @message_id
end

Instance Method Details

#filterable?Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/adlint/postfilter/content.rb', line 105

def filterable?
  true
end

#match_with?(suppression) ⇒ Boolean

Returns:

  • (Boolean)


109
110
111
# File 'lib/adlint/postfilter/content.rb', line 109

def match_with?(suppression)
  suppression._match_with?(self)
end