Class: RDG::Control::Def

Inherits:
Object
  • Object
show all
Defined in:
lib/rdg/control/def.rb

Instance Method Summary collapse

Constructor Details

#initialize(ast_node, graph, state) ⇒ Def



4
5
6
7
# File 'lib/rdg/control/def.rb', line 4

def initialize(ast_node, graph, state)
  @graph, @state = graph, state
  @name, @args, @body = ast_node.children
end

Instance Method Details

#analyseObject



9
10
11
12
# File 'lib/rdg/control/def.rb', line 9

def analyse
  @state[:current_method] = @name
  @graph.add_edge(@name, @body)
end