Class: Steep::Diagnostic::Ruby::UnresolvedOverloading
- Defined in:
- lib/steep/diagnostic/ruby.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#method_types ⇒ Object
readonly
Returns the value of attribute method_types.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#receiver_type ⇒ Object
readonly
Returns the value of attribute receiver_type.
Attributes inherited from Base
Instance Method Summary collapse
- #detail_lines ⇒ Object
- #header_line ⇒ Object
-
#initialize(node:, receiver_type:, method_name:, method_types:) ⇒ UnresolvedOverloading
constructor
A new instance of UnresolvedOverloading.
Methods inherited from Base
Methods included from Helper
Constructor Details
#initialize(node:, receiver_type:, method_name:, method_types:) ⇒ UnresolvedOverloading
Returns a new instance of UnresolvedOverloading.
193 194 195 196 197 198 |
# File 'lib/steep/diagnostic/ruby.rb', line 193 def initialize(node:, receiver_type:, method_name:, method_types:) super node: node @receiver_type = receiver_type @method_name = method_name @method_types = method_types end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
190 191 192 |
# File 'lib/steep/diagnostic/ruby.rb', line 190 def method_name @method_name end |
#method_types ⇒ Object (readonly)
Returns the value of attribute method_types.
191 192 193 |
# File 'lib/steep/diagnostic/ruby.rb', line 191 def method_types @method_types end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
188 189 190 |
# File 'lib/steep/diagnostic/ruby.rb', line 188 def node @node end |
#receiver_type ⇒ Object (readonly)
Returns the value of attribute receiver_type.
189 190 191 |
# File 'lib/steep/diagnostic/ruby.rb', line 189 def receiver_type @receiver_type end |
Instance Method Details
#detail_lines ⇒ Object
204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/steep/diagnostic/ruby.rb', line 204 def detail_lines StringIO.new.tap do |io| io.puts "Method types:" first_type, *rest_types = method_types defn = " def #{method_name}" io.puts "#{defn}: #{first_type}" rest_types.each do |method_type| io.puts "#{" " * defn.size}| #{method_type}" end end.string.chomp end |
#header_line ⇒ Object
200 201 202 |
# File 'lib/steep/diagnostic/ruby.rb', line 200 def header_line "Cannot find compatible overloading of method `#{method_name}` of type `#{receiver_type}`" end |