Class: ActiveInteractor::Context::Base
- Inherits:
-
Object
- Object
- ActiveInteractor::Context::Base
- Includes:
- ActiveModelErrorMethods, AttributeAssignment, AttributeRegistration, Type::DeclerationMethods
- Defined in:
- lib/active_interactor/context/base.rb
Constant Summary
Constants included from Type::DeclerationMethods
Type::DeclerationMethods::Boolean
Instance Attribute Summary
Attributes included from ActiveModelErrorMethods
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
- #validate! ⇒ Object
Methods included from AttributeAssignment
Methods included from ActiveModelErrorMethods
#read_attribute_for_validation
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of Base.
11 12 13 14 |
# File 'lib/active_interactor/context/base.rb', line 11 def initialize(attributes = {}) super @errors = ActiveModel::Errors.new(self) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveInteractor::Context::AttributeAssignment
Instance Method Details
#validate! ⇒ Object
16 17 18 19 20 21 |
# File 'lib/active_interactor/context/base.rb', line 16 def validate! attribute_set.attributes.each do |attribute| attribute.validate! attribute..each { || errors.add(attribute.name, ) } end end |