Module: ActiveInteractor
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/active_interactor.rb,
lib/active_interactor/version.rb
Overview
ActiveInteractor.
Defined Under Namespace
Modules: ClassMethods, Interface Classes: Result
Constant Summary collapse
- VERSION =
'0.2.0'.freeze
Instance Method Summary collapse
- #call ⇒ Object
- #errors ⇒ ActiveModel::Errors
-
#merge_errors(additional_errors) ⇒ void
Merge the given errors into #errors.
-
#validator ⇒ ActiveModel::Validations
An instance of ClassMethods#validator_class.
Instance Method Details
#call ⇒ Object
165 166 167 |
# File 'lib/active_interactor.rb', line 165 def call(*) raise NotImplementedError end |
#errors ⇒ ActiveModel::Errors
170 171 172 |
# File 'lib/active_interactor.rb', line 170 def errors validator.errors end |
#merge_errors(additional_errors) ⇒ void
This method returns an undefined value.
Merge the given errors into #errors.
178 179 180 181 182 |
# File 'lib/active_interactor.rb', line 178 def merge_errors(additional_errors) additional_errors..each do || errors.add(:base, ) end end |
#validator ⇒ ActiveModel::Validations
Returns an instance of ActiveInteractor::ClassMethods#validator_class.
185 186 187 |
# File 'lib/active_interactor.rb', line 185 def validator @validator ||= self.class.validator_class.new end |