Class: Steep::Diagnostic::Ruby::DeprecatedReference
- Defined in:
- lib/steep/diagnostic/ruby.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Attributes inherited from Base
Instance Method Summary collapse
- #header_line ⇒ Object
-
#initialize(node:, location:, message:) ⇒ DeprecatedReference
constructor
A new instance of DeprecatedReference.
Methods inherited from Base
#detail_lines, #diagnostic_code
Methods included from Helper
Constructor Details
#initialize(node:, location:, message:) ⇒ DeprecatedReference
Returns a new instance of DeprecatedReference.
1056 1057 1058 1059 |
# File 'lib/steep/diagnostic/ruby.rb', line 1056 def initialize(node:, location:, message:) super(node: node, location: location) @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
1054 1055 1056 |
# File 'lib/steep/diagnostic/ruby.rb', line 1054 def @message end |
Instance Method Details
#header_line ⇒ Object
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 |
# File 'lib/steep/diagnostic/ruby.rb', line 1061 def header_line header = case node&.type when :send, :csend, :block, :numblock "The method is deprecated" when :const, :casgn "The constant is deprecated" when :gvar, :gvasgn "The global variable is deprecated" else raise "Unexpected node: #{node}" end if header = +header header.concat(": ", ) end header end |