Class: Steep::Diagnostic::Ruby::InsufficientKeywordArguments
- Defined in:
- lib/steep/diagnostic/ruby.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#method_type ⇒ Object
readonly
Returns the value of attribute method_type.
-
#missing_keywords ⇒ Object
readonly
Returns the value of attribute missing_keywords.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Attributes inherited from Base
Instance Method Summary collapse
- #header_line ⇒ Object
-
#initialize(node:, params:, missing_keywords:) ⇒ InsufficientKeywordArguments
constructor
A new instance of InsufficientKeywordArguments.
Methods inherited from Base
#detail_lines, #diagnostic_code
Methods included from Helper
Constructor Details
#initialize(node:, params:, missing_keywords:) ⇒ InsufficientKeywordArguments
Returns a new instance of InsufficientKeywordArguments.
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/steep/diagnostic/ruby.rb', line 162 def initialize(node:, params:, missing_keywords:) send = case node.type when :send, :csend node when :block, :numblock node.children[0] end loc = if send send.loc.selector.with(end_pos: send.loc.expression.end_pos) # steep:ignore NoMethod else node.loc.expression end super(node: node, location: loc) @params = params @missing_keywords = missing_keywords end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
158 159 160 |
# File 'lib/steep/diagnostic/ruby.rb', line 158 def method_name @method_name end |
#method_type ⇒ Object (readonly)
Returns the value of attribute method_type.
159 160 161 |
# File 'lib/steep/diagnostic/ruby.rb', line 159 def method_type @method_type end |
#missing_keywords ⇒ Object (readonly)
Returns the value of attribute missing_keywords.
160 161 162 |
# File 'lib/steep/diagnostic/ruby.rb', line 160 def missing_keywords @missing_keywords end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
157 158 159 |
# File 'lib/steep/diagnostic/ruby.rb', line 157 def node @node end |
Instance Method Details
#header_line ⇒ Object
182 183 184 |
# File 'lib/steep/diagnostic/ruby.rb', line 182 def header_line "More keyword arguments are required: #{missing_keywords.join(", ")}" end |