Module: Reek::AST::SexpExtensions::DefsNode

Includes:
MethodNodeBase
Defined in:
lib/reek/ast/sexp_extensions/methods.rb

Overview

Utility methods for :defs nodes.

Instance Method Summary collapse

Methods included from MethodNodeBase

#arg_names, #arguments, #body_nodes, #ends_with_bang?, #name_without_bang, #parameter_names, #parameters

Instance Method Details

#argslistObject



77
78
79
# File 'lib/reek/ast/sexp_extensions/methods.rb', line 77

def argslist
  children[2]
end

#bodyObject



81
82
83
# File 'lib/reek/ast/sexp_extensions/methods.rb', line 81

def body
  children[3]
end

#depends_on_instance?Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/reek/ast/sexp_extensions/methods.rb', line 90

def depends_on_instance?
  false
end

#full_name(outer) ⇒ Object



85
86
87
88
# File 'lib/reek/ast/sexp_extensions/methods.rb', line 85

def full_name(outer)
  prefix = outer == '' ? '' : "#{outer}#"
  "#{prefix}#{receiver.name}.#{name}"
end

#nameObject



73
74
75
# File 'lib/reek/ast/sexp_extensions/methods.rb', line 73

def name
  children[1]
end

#receiverObject



69
70
71
# File 'lib/reek/ast/sexp_extensions/methods.rb', line 69

def receiver
  children.first
end