Class: Yes::Core::Aggregate::Dsl::MethodDefiners::Attribute::Accessor
- Defined in:
- lib/yes/core/aggregate/dsl/method_definers/attribute/accessor.rb
Overview
Defines the accessor method for an attribute
Instance Method Summary collapse
-
#call ⇒ void
Defines a reader method for the attribute that reads from the read model.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Yes::Core::Aggregate::Dsl::MethodDefiners::Attribute::Base
Instance Method Details
#call ⇒ void
This method returns an undefined value.
Defines a reader method for the attribute that reads from the read model
13 14 15 16 17 18 19 20 21 |
# File 'lib/yes/core/aggregate/dsl/method_definers/attribute/accessor.rb', line 13 def call name = @name aggregate_class.define_method(name) do return nil unless self.class.read_model_enabled? read_model.public_send(name) end end |