Module: Lims::Core::Actions::Action
- Extended by:
- SubclassTracker
- Included in:
- TestActionGroup::Action, Persistence::Search::CreateSearch
- Defined in:
- lib/lims-core/actions/action.rb
Overview
This mixin add the Action behavior to a Class. An action can be called and reverted (if possible) within a session. For this, the action must implements the _call_in_session and _revert_in_session. Those methods are private and take a session as a parameter. The public equivalent (call/revert) will create a session (using the store) and call the corresponding methods.
Defined Under Namespace
Modules: AfterEval Classes: InvalidParameters
Constant Summary collapse
- UnrevertableAction =
Class.new(StandardError)
Class Method Summary collapse
Methods included from SubclassTracker
Class Method Details
.included(klass) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/lims-core/actions/action.rb', line 22 def self.included(klass) klass.class_eval do include Base attribute :store, Persistence::Store, :required => true attribute :user, Object, :required => true, :writer => :private, :initializable => true attribute :application, String, :required => true attribute :result, Object include AfterEval # hack so initialize would be called properly end tracker_included(klass) end |
.tracker_included ⇒ Object
19 |
# File 'lib/lims-core/actions/action.rb', line 19 alias_method :tracker_included, :included |