Class: ArchSpec::Suppression

Inherits:
Data
  • Object
show all
Defined in:
lib/archspec/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#end_lineObject (readonly)

Returns the value of attribute end_line

Returns:

  • (Object)

    the current value of end_line



8
9
10
# File 'lib/archspec/model.rb', line 8

def end_line
  @end_line
end

#reasonObject (readonly)

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



8
9
10
# File 'lib/archspec/model.rb', line 8

def reason
  @reason
end

#ruleObject (readonly)

Returns the value of attribute rule

Returns:

  • (Object)

    the current value of rule



8
9
10
# File 'lib/archspec/model.rb', line 8

def rule
  @rule
end

#start_lineObject (readonly)

Returns the value of attribute start_line

Returns:

  • (Object)

    the current value of start_line



8
9
10
# File 'lib/archspec/model.rb', line 8

def start_line
  @start_line
end

Instance Method Details

#matches?(diagnostic) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
13
# File 'lib/archspec/model.rb', line 9

def matches?(diagnostic)
  (rule.nil? || rule == diagnostic.rule) &&
    diagnostic.location.line >= start_line &&
    diagnostic.location.line <= end_line
end