Class: LanguageServer::Linter::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/linter/ruby_wc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line_num:, characters: 0..0, message:, type:) ⇒ Error

Returns a new instance of Error.



8
9
10
11
12
13
# File 'lib/language_server/linter/ruby_wc.rb', line 8

def initialize(line_num:, characters: 0..0, message:, type:)
  @line_num = line_num
  @characters = characters
  @message = message
  @type = type
end

Instance Attribute Details

#charactersObject (readonly)

Returns the value of attribute characters.



6
7
8
# File 'lib/language_server/linter/ruby_wc.rb', line 6

def characters
  @characters
end

#line_numObject (readonly)

Returns the value of attribute line_num.



6
7
8
# File 'lib/language_server/linter/ruby_wc.rb', line 6

def line_num
  @line_num
end

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/language_server/linter/ruby_wc.rb', line 6

def message
  @message
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/language_server/linter/ruby_wc.rb', line 6

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object



19
20
21
# File 'lib/language_server/linter/ruby_wc.rb', line 19

def ==(other)
  line_num == other.line_num && characters == other.characters && message == other.message
end

#warning?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/language_server/linter/ruby_wc.rb', line 15

def warning?
  @type == "warning"
end