Class: Aldous::Controller::Action::Wrapper
- Inherits:
-
Object
- Object
- Aldous::Controller::Action::Wrapper
- Defined in:
- lib/aldous/controller/action/wrapper.rb
Instance Attribute Summary collapse
-
#controller_action ⇒ Object
readonly
Returns the value of attribute controller_action.
Instance Method Summary collapse
- #controller ⇒ Object
- #default_error_handler(error) ⇒ Object
- #default_view_data ⇒ Object
-
#initialize(controller_action) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #perform ⇒ Object
- #preconditions ⇒ Object
- #view_builder ⇒ Object
Constructor Details
#initialize(controller_action) ⇒ Wrapper
Returns a new instance of Wrapper.
10 11 12 |
# File 'lib/aldous/controller/action/wrapper.rb', line 10 def initialize(controller_action) @controller_action = controller_action end |
Instance Attribute Details
#controller_action ⇒ Object (readonly)
Returns the value of attribute controller_action.
8 9 10 |
# File 'lib/aldous/controller/action/wrapper.rb', line 8 def controller_action @controller_action end |
Instance Method Details
#controller ⇒ Object
26 27 28 |
# File 'lib/aldous/controller/action/wrapper.rb', line 26 def controller controller_action.controller end |
#default_error_handler(error) ⇒ Object
22 23 24 |
# File 'lib/aldous/controller/action/wrapper.rb', line 22 def default_error_handler(error) controller_action.default_error_handler(error) end |
#default_view_data ⇒ Object
18 19 20 |
# File 'lib/aldous/controller/action/wrapper.rb', line 18 def default_view_data controller_action.default_view_data end |
#perform ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/aldous/controller/action/wrapper.rb', line 34 def perform controller_action.perform rescue => e ::Aldous::LoggingWrapper.log(e) error_handler = default_error_handler(e) if error_handler.kind_of?(Class) && error_handler.ancestors.include?(Aldous::Respondable::Base) view_builder.build(error_handler, errors: [e]) end end |
#preconditions ⇒ Object
14 15 16 |
# File 'lib/aldous/controller/action/wrapper.rb', line 14 def preconditions controller_action.preconditions end |
#view_builder ⇒ Object
30 31 32 |
# File 'lib/aldous/controller/action/wrapper.rb', line 30 def view_builder controller_action.view_builder end |