Module: Reek::AST::SexpExtensions::MethodNodeBase Private
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Base module for utility methods for :def and :defs nodes.
Instance Method Summary collapse
- #arg_names ⇒ Object private
- #arguments ⇒ Object private
- #body_nodes(types, ignoring = []) ⇒ Object private
- #ends_with_bang? ⇒ Boolean private
- #name_without_bang ⇒ Object private
- #parameter_names ⇒ Object private
- #parameters ⇒ Object private
Instance Method Details
#arg_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
223 224 225 |
# File 'lib/reek/ast/sexp_extensions.rb', line 223 def arg_names arguments.map(&:name) end |
#arguments ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
219 220 221 |
# File 'lib/reek/ast/sexp_extensions.rb', line 219 def arguments parameters.reject(&:block?) end |
#body_nodes(types, ignoring = []) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
243 244 245 246 247 248 249 |
# File 'lib/reek/ast/sexp_extensions.rb', line 243 def body_nodes(types, ignoring = []) if body body.find_nodes(types, ignoring) else [] end end |
#ends_with_bang? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
239 240 241 |
# File 'lib/reek/ast/sexp_extensions.rb', line 239 def ends_with_bang? name[-1] == '!' end |
#name_without_bang ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
235 236 237 |
# File 'lib/reek/ast/sexp_extensions.rb', line 235 def name_without_bang name.to_s.chop end |
#parameter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
231 232 233 |
# File 'lib/reek/ast/sexp_extensions.rb', line 231 def parameter_names parameters.map(&:name) end |
#parameters ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
227 228 229 |
# File 'lib/reek/ast/sexp_extensions.rb', line 227 def parameters argslist.components end |