Class: Defs
- Inherits:
-
Parser::AST::Processor
- Object
- Parser::AST::Processor
- Defs
- Defined in:
- lib/code_explorer/call_graph.rb
Instance Method Summary collapse
- #defs_from_ast(ast) ⇒ Object
-
#initialize ⇒ Defs
constructor
A new instance of Defs.
- #on_def(node) ⇒ Object
- #on_defs(node) ⇒ Object
- #on_send(node) ⇒ Object
- #sends_from_ast(ast) ⇒ Object
Constructor Details
#initialize ⇒ Defs
Returns a new instance of Defs.
52 53 54 55 |
# File 'lib/code_explorer/call_graph.rb', line 52 def initialize @defs = [] @sends = [] end |
Instance Method Details
#defs_from_ast(ast) ⇒ Object
57 58 59 60 61 |
# File 'lib/code_explorer/call_graph.rb', line 57 def defs_from_ast(ast) @defs = [] process(ast) @defs end |
#on_def(node) ⇒ Object
69 70 71 72 |
# File 'lib/code_explorer/call_graph.rb', line 69 def on_def(node) @defs << node super end |
#on_defs(node) ⇒ Object
74 75 76 77 |
# File 'lib/code_explorer/call_graph.rb', line 74 def on_defs(node) @defs << node super end |
#on_send(node) ⇒ Object
79 80 81 82 |
# File 'lib/code_explorer/call_graph.rb', line 79 def on_send(node) @sends << node super end |
#sends_from_ast(ast) ⇒ Object
63 64 65 66 67 |
# File 'lib/code_explorer/call_graph.rb', line 63 def sends_from_ast(ast) @sends = [] process(ast) @sends end |