Class: ADSL::Extract::Rails::ActionRunner
- Includes:
- Parser
- Defined in:
- lib/adsl/extract/rails/action_runner.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
- #callbacks ⇒ Object
-
#initialize(controller, action) ⇒ ActionRunner
constructor
A new instance of ActionRunner.
- #root_paths_to_stmts(root_paths) ⇒ Object
- #run_action ⇒ Object
- #run_after_filter(higher_root_paths) ⇒ Object
- #run_around_filter ⇒ Object
- #run_before_filter(higher_root_paths) ⇒ Object
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
#action ⇒ Object (readonly)
Returns the value of attribute action.
9 10 11 |
# File 'lib/adsl/extract/rails/action_runner.rb', line 9 def action @action end |
#controller ⇒ Object (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
#callbacks ⇒ Object
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_action ⇒ Object
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_filter ⇒ Object
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 |