Module: RipperRubyParser::SexpHandlers::Methods Private
- Defined in:
- lib/ripper_ruby_parser/sexp_handlers/methods.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.
Sexp handers for method definitions and related constructs
Instance Method Summary collapse
- #process_alias(exp) ⇒ Object private
- #process_args_forward(exp) ⇒ Object private
- #process_def(exp) ⇒ Object private
- #process_defs(exp) ⇒ Object private
- #process_return(exp) ⇒ Object private
- #process_return0(exp) ⇒ Object private
- #process_undef(exp) ⇒ Object private
- #process_yield(exp) ⇒ Object private
- #process_yield0(exp) ⇒ Object private
Instance Method Details
#process_alias(exp) ⇒ 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.
69 70 71 72 73 |
# File 'lib/ripper_ruby_parser/sexp_handlers/methods.rb', line 69 def process_alias(exp) _, left, right = exp.shift 3 s(:alias, process(left), process(right)) end |
#process_args_forward(exp) ⇒ 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.
75 76 77 78 |
# File 'lib/ripper_ruby_parser/sexp_handlers/methods.rb', line 75 def process_args_forward(exp) _ = exp.shift s(:forward_args) end |
#process_def(exp) ⇒ 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.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ripper_ruby_parser/sexp_handlers/methods.rb', line 7 def process_def(exp) _, ident, params, body, pos = exp.shift 5 ident = extract_node_symbol ident in_method do params = convert_arguments(process(params)) kwrest = kwrest_param(params) body = with_new_lvar_scope(kwrest) { method_body(body) } end with_position(pos, s(:defn, ident, params, *body)) end |
#process_defs(exp) ⇒ 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.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ripper_ruby_parser/sexp_handlers/methods.rb', line 21 def process_defs(exp) _, receiver, _, ident, params, body, = exp.shift 7 ident = extract_node_symbol ident in_method do params = convert_arguments(process(params)) kwrest = kwrest_param(params) body = with_new_lvar_scope(kwrest) { method_body(body) } end s(:defs, process(receiver), ident, params, *body) end |
#process_return(exp) ⇒ 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.
35 36 37 38 |
# File 'lib/ripper_ruby_parser/sexp_handlers/methods.rb', line 35 def process_return(exp) _, arglist = exp.shift 2 s(:return, handle_return_argument_list(arglist)) end |
#process_return0(exp) ⇒ 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.
40 41 42 43 |
# File 'lib/ripper_ruby_parser/sexp_handlers/methods.rb', line 40 def process_return0(exp) exp.shift s(:return) end |
#process_undef(exp) ⇒ 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.
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/ripper_ruby_parser/sexp_handlers/methods.rb', line 55 def process_undef(exp) _, args = exp.shift 2 args.map! do |sub_exp| s(:undef, process(sub_exp)) end if args.size == 1 args.first else s(:block, *args) end end |
#process_yield(exp) ⇒ 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.
45 46 47 48 |
# File 'lib/ripper_ruby_parser/sexp_handlers/methods.rb', line 45 def process_yield(exp) _, arglist = exp.shift 2 s(:yield, *process(arglist).sexp_body) end |
#process_yield0(exp) ⇒ 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.
50 51 52 53 |
# File 'lib/ripper_ruby_parser/sexp_handlers/methods.rb', line 50 def process_yield0(exp) exp.shift s(:yield) end |