Class: Aldous::Controller::Action::Precondition::Wrapper
- Inherits:
-
Object
- Object
- Aldous::Controller::Action::Precondition::Wrapper
- Defined in:
- lib/aldous/controller/action/precondition/wrapper.rb
Instance Attribute Summary collapse
-
#precondition ⇒ Object
readonly
Returns the value of attribute precondition.
Instance Method Summary collapse
- #default_error_respondable ⇒ Object
- #default_view_data ⇒ Object
-
#initialize(precondition) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #perform ⇒ Object
Constructor Details
#initialize(precondition) ⇒ Wrapper
Returns a new instance of Wrapper.
10 11 12 |
# File 'lib/aldous/controller/action/precondition/wrapper.rb', line 10 def initialize(precondition) @precondition = precondition end |
Instance Attribute Details
#precondition ⇒ Object (readonly)
Returns the value of attribute precondition.
8 9 10 |
# File 'lib/aldous/controller/action/precondition/wrapper.rb', line 8 def precondition @precondition end |
Instance Method Details
#default_error_respondable ⇒ Object
18 19 20 |
# File 'lib/aldous/controller/action/precondition/wrapper.rb', line 18 def default_error_respondable precondition.action.default_error_respondable end |
#default_view_data ⇒ Object
14 15 16 |
# File 'lib/aldous/controller/action/precondition/wrapper.rb', line 14 def default_view_data precondition.action.default_view_data end |
#perform ⇒ Object
22 23 24 25 26 27 |
# File 'lib/aldous/controller/action/precondition/wrapper.rb', line 22 def perform precondition.perform rescue => e ::Aldous::LoggingWrapper.log(e) precondition.build_view(default_error_respondable, errors: [e]) end |