Class: Ruby::Reforge::Issue

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/reforge/scanner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, file:, line:, message:, old_code: nil, new_code: nil) ⇒ Issue

Returns a new instance of Issue.



156
157
158
159
160
161
162
163
# File 'lib/ruby/reforge/scanner.rb', line 156

def initialize(type:, file:, line:, message:, old_code: nil, new_code: nil)
  @type = type
  @file = file
  @line = line
  @message = message
  @old_code = old_code
  @new_code = new_code
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



154
155
156
# File 'lib/ruby/reforge/scanner.rb', line 154

def file
  @file
end

#lineObject (readonly)

Returns the value of attribute line.



154
155
156
# File 'lib/ruby/reforge/scanner.rb', line 154

def line
  @line
end

#messageObject (readonly)

Returns the value of attribute message.



154
155
156
# File 'lib/ruby/reforge/scanner.rb', line 154

def message
  @message
end

#new_codeObject (readonly)

Returns the value of attribute new_code.



154
155
156
# File 'lib/ruby/reforge/scanner.rb', line 154

def new_code
  @new_code
end

#old_codeObject (readonly)

Returns the value of attribute old_code.



154
155
156
# File 'lib/ruby/reforge/scanner.rb', line 154

def old_code
  @old_code
end

#typeObject (readonly)

Returns the value of attribute type.



154
155
156
# File 'lib/ruby/reforge/scanner.rb', line 154

def type
  @type
end

Instance Method Details

#severityObject



165
166
167
168
169
170
171
172
173
174
# File 'lib/ruby/reforge/scanner.rb', line 165

def severity
  case @type
  when :deprecated_method, :deprecated_pattern
    :warning
  when :breaking_change
    :error
  else
    :info
  end
end