Class: Ea::Lint::Offense

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

Overview

One lint offense. Carries rule name, severity, entity id/name, and a human-readable message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entity_idObject

Returns the value of attribute entity_id

Returns:

  • (Object)

    the current value of entity_id



7
8
9
# File 'lib/ea/lint/offense.rb', line 7

def entity_id
  @entity_id
end

#entity_nameObject

Returns the value of attribute entity_name

Returns:

  • (Object)

    the current value of entity_name



7
8
9
# File 'lib/ea/lint/offense.rb', line 7

def entity_name
  @entity_name
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



7
8
9
# File 'lib/ea/lint/offense.rb', line 7

def message
  @message
end

#ruleObject

Returns the value of attribute rule

Returns:

  • (Object)

    the current value of rule



7
8
9
# File 'lib/ea/lint/offense.rb', line 7

def rule
  @rule
end

#severityObject

Returns the value of attribute severity

Returns:

  • (Object)

    the current value of severity



7
8
9
# File 'lib/ea/lint/offense.rb', line 7

def severity
  @severity
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/ea/lint/offense.rb', line 9

def error?
  severity == :error
end

#warning?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/ea/lint/offense.rb', line 13

def warning?
  severity == :warning
end