Module: Reek::Source::SexpExtensions::ArgNodeBase

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

Overview

Base module for utility methods for argument nodes.

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object

Other is a symbol?


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

def ==(other)
  name == other
end

#anonymous_splat?Boolean


33
34
35
# File 'lib/reek/source/sexp_extensions.rb', line 33

def anonymous_splat?
  false
end

#block?Boolean


25
26
27
# File 'lib/reek/source/sexp_extensions.rb', line 25

def block?
  false
end

#marked_unused?Boolean


17
18
19
# File 'lib/reek/source/sexp_extensions.rb', line 17

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

#nameObject


8
9
10
# File 'lib/reek/source/sexp_extensions.rb', line 8

def name
  children.first
end

#optional_argument?Boolean


29
30
31
# File 'lib/reek/source/sexp_extensions.rb', line 29

def optional_argument?
  false
end

#plain_nameObject


21
22
23
# File 'lib/reek/source/sexp_extensions.rb', line 21

def plain_name
  name.to_s
end