Module: Reek::AST::SexpExtensions::ArgNodeBase Private

Included in:
ArgNode, BlockargNode, KwargNode, KwoptargNode, KwrestargNode, OptargNode, RestargNode, ShadowargNode
Defined in:
lib/reek/ast/sexp_extensions.rb

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 argument nodes.

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ 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.

Other is a symbol?



18
19
20
# File 'lib/reek/ast/sexp_extensions.rb', line 18

def ==(other)
  name == other
end

#anonymous_splat?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.

Returns:

  • (Boolean)


38
39
40
# File 'lib/reek/ast/sexp_extensions.rb', line 38

def anonymous_splat?
  false
end

#block?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.

Returns:

  • (Boolean)


30
31
32
# File 'lib/reek/ast/sexp_extensions.rb', line 30

def block?
  false
end

#componentsObject

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.



42
43
44
# File 'lib/reek/ast/sexp_extensions.rb', line 42

def components
  [self]
end

#marked_unused?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.

Returns:

  • (Boolean)


22
23
24
# File 'lib/reek/ast/sexp_extensions.rb', line 22

def marked_unused?
  plain_name.start_with?('_')
end

#nameObject

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.



13
14
15
# File 'lib/reek/ast/sexp_extensions.rb', line 13

def name
  children.first
end

#optional_argument?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.

Returns:

  • (Boolean)


34
35
36
# File 'lib/reek/ast/sexp_extensions.rb', line 34

def optional_argument?
  false
end

#plain_nameObject

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.



26
27
28
# File 'lib/reek/ast/sexp_extensions.rb', line 26

def plain_name
  name.to_s
end