Module: ImproveYourCode::AST::SexpExtensions::DefNode
- Includes:
- MethodNodeBase
- Defined in:
- lib/improve_your_code/ast/sexp_extensions/methods.rb
Overview
Utility methods for :def nodes.
Instance Method Summary
collapse
#arg_names, #arguments, #ends_with_bang?, #name_without_bang, #parameter_names, #parameters
Instance Method Details
#argslist ⇒ Object
41
42
43
|
# File 'lib/improve_your_code/ast/sexp_extensions/methods.rb', line 41
def argslist
children[1]
end
|
#body ⇒ Object
45
46
47
|
# File 'lib/improve_your_code/ast/sexp_extensions/methods.rb', line 45
def body
children[2]
end
|
#full_name(outer) ⇒ Object
49
50
51
|
# File 'lib/improve_your_code/ast/sexp_extensions/methods.rb', line 49
def full_name(outer)
[outer, name].reject(&:empty?).join('#')
end
|
#name ⇒ Object
37
38
39
|
# File 'lib/improve_your_code/ast/sexp_extensions/methods.rb', line 37
def name
children.first
end
|