Sha256: 416e74a35df6626a49f2d8f62a0c4442b6ceb241747acb58c3d52928f3215a0c
Contents?: true
Size: 936 Bytes
Versions: 2
Compression:
Stored size: 936 Bytes
Contents
require 'aldous/respondable/base' require 'aldous/controller/action/precondition/wrapper' module Aldous module Controller class PreconditionsExecutionService attr_reader :action, :controller def initialize(action, controller) @action = action @controller = controller end def perform if action.respond_to?(:preconditions) && !action.preconditions.empty? action.preconditions.each do |precondition_class| # action here is actually an action wrapper hence the # action.controller_action below precondition = precondition_class.build(action.controller_action) precondition_result = precondition.perform if precondition_result.kind_of?(::Aldous::Respondable::Base) return [precondition, precondition_result] end end end [nil, nil] end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
aldous-1.0.1 | lib/aldous/controller/preconditions_execution_service.rb |
aldous-1.0.0 | lib/aldous/controller/preconditions_execution_service.rb |