Module: ActiveInteractor::Models
- Defined in:
- lib/active_interactor/models.rb
Overview
Helper methods for using classes that do not inherit from Context::Base as context objects for interactors. Classes should extend Models.
Instance Method Summary collapse
-
#acts_as_context ⇒ Object
Include methods needed for a context class to function properly.
Instance Method Details
#acts_as_context ⇒ Object
Note:
You must include ActiveModel::Model and ActiveModel::Attributes or a similar implementation for the object to function properly.
Include methods needed for a context class to function properly.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/active_interactor/models.rb', line 38 def acts_as_context class_eval do extend ActiveInteractor::Context::Attributes::ClassMethods include ActiveInteractor::Context::Attributes include ActiveInteractor::Context::Errors include ActiveInteractor::Context::Status include ActiveInteractor::Models::InstanceMethods delegate :each_pair, to: :attributes end end |