Module: ImproveYourCode::AST::SexpExtensions::DefsNode
- Includes:
- MethodNodeBase
- Defined in:
- lib/improve_your_code/ast/sexp_extensions/methods.rb
Overview
Utility methods for :defs nodes.
Instance Method Summary
collapse
#arg_names, #arguments, #ends_with_bang?, #name_without_bang, #parameter_names, #parameters
Instance Method Details
#argslist ⇒ Object
66
67
68
|
# File 'lib/improve_your_code/ast/sexp_extensions/methods.rb', line 66
def argslist
children[2]
end
|
#body ⇒ Object
70
71
72
|
# File 'lib/improve_your_code/ast/sexp_extensions/methods.rb', line 70
def body
children[3]
end
|
#full_name(outer) ⇒ Object
74
75
76
77
|
# File 'lib/improve_your_code/ast/sexp_extensions/methods.rb', line 74
def full_name(outer)
prefix = outer == '' ? '' : "#{outer}#"
"#{prefix}#{receiver.name}.#{name}"
end
|
#name ⇒ Object
62
63
64
|
# File 'lib/improve_your_code/ast/sexp_extensions/methods.rb', line 62
def name
children[1]
end
|
#receiver ⇒ Object
58
59
60
|
# File 'lib/improve_your_code/ast/sexp_extensions/methods.rb', line 58
def receiver
children.first
end
|