Module: ComputedModel::Model
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/computed_model/model.rb
Overview
A mixin for batch-loadable compound models. This is the main API of ComputedModel.
See ClassMethods for methods you can use in the including classes.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#current_deps ⇒ Set<Symbol>
Returns dependency of the currently computing field, or the toplevel dependency if called outside of computed fields.
-
#current_subfields ⇒ ComputedModel::NormalizableArray?
Returns subfield selectors passed to the currently computing field, or nil if called outside of computed fields.
Instance Method Details
#current_deps ⇒ Set<Symbol>
Returns dependency of the currently computing field, or the toplevel dependency if called outside of computed fields.
430 431 432 |
# File 'lib/computed_model/model.rb', line 430 def current_deps @__computed_model_stack.last.deps end |
#current_subfields ⇒ ComputedModel::NormalizableArray?
Returns subfield selectors passed to the currently computing field, or nil if called outside of computed fields.
437 438 439 |
# File 'lib/computed_model/model.rb', line 437 def current_subfields @__computed_model_stack.last.subfields end |