Class: ADSL::Extract::Rails::ActionRunner

Inherits:
Object
  • Object
show all
Includes:
Parser
Defined in:
lib/adsl/extract/rails/action_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, action) ⇒ ActionRunner

Returns a new instance of ActionRunner.



11
12
13
14
# File 'lib/adsl/extract/rails/action_runner.rb', line 11

def initialize(controller, action)
  @controller = controller
  @action = action
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



9
10
11
# File 'lib/adsl/extract/rails/action_runner.rb', line 9

def action
  @action
end

#controllerObject (readonly)

Returns the value of attribute controller.



9
10
11
# File 'lib/adsl/extract/rails/action_runner.rb', line 9

def controller
  @controller
end

Instance Method Details

#callbacksObject



16
17
18
# File 'lib/adsl/extract/rails/action_runner.rb', line 16

def callbacks
  @controller._process_action_callbacks
end

#root_paths_to_stmts(root_paths) ⇒ Object



20
21
22
23
# File 'lib/adsl/extract/rails/action_runner.rb', line 20

def root_paths_to_stmts(root_paths)
  return root_paths.first.statements if root_paths.length == 1
  [ASTEither.new(:blocks => root_paths)]
end

#run_actionObject



25
26
27
28
29
# File 'lib/adsl/extract/rails/action_runner.rb', line 25

def run_action


  action_root_paths = action_adsl_ast.blocks.map{ |block| [block, false] }
end

#run_after_filter(higher_root_paths) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'lib/adsl/extract/rails/action_runner.rb', line 41

def run_after_filter(higher_root_paths)
  filter_root_paths =

  higher_root_paths.each do |block, chain_halted|
    block += root_paths_to_stmts(filter_root_paths) unless chain_halted
  end

  higher_root_paths
end

#run_around_filterObject



51
52
53
# File 'lib/adsl/extract/rails/action_runner.rb', line 51

def run_around_filter

end

#run_before_filter(higher_root_paths) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/adsl/extract/rails/action_runner.rb', line 31

def run_before_filter(higher_root_paths)
  filter_root_paths = 

  filter_root_paths.each do |block, chain_halted|
    block += root_paths_to_stmts(higher_root_paths) unless chain_halted
  end

  filter_root_paths
end