class ESLintRails::Warning

Constants

SEVERITY

Attributes

column[R]
filename[R]
line[R]
node_type[R]

Public Class Methods

new(filename, warning_hash) click to toggle source
# File lib/eslint-rails/warning.rb, line 8
def initialize(filename, warning_hash)
  @filename = filename
  @rule_id = warning_hash['ruleId'] || "unexpected error"
  @severity = warning_hash['severity']
  @message = warning_hash['message']
  @line = warning_hash['line']
  @column = warning_hash['column']
  @node_type = warning_hash['nodeType']
end

Public Instance Methods

location() click to toggle source
# File lib/eslint-rails/warning.rb, line 22
def location
  "#{filename}:#{line}:#{column}"
end
message() click to toggle source
# File lib/eslint-rails/warning.rb, line 30
def message
  @message || 'N/A'
end
rule_id() click to toggle source
# File lib/eslint-rails/warning.rb, line 26
def rule_id
  @rule_id || 'N/A'
end
severity() click to toggle source
# File lib/eslint-rails/warning.rb, line 18
def severity
  SEVERITY[@severity-1]
end