Class: Interdependence::DependencyResolver::Model
- Defined in:
- lib/interdependence/dependency_resolver/model.rb
Overview
resolver for model dependencies
Constant Summary collapse
- CACHE =
{}
Instance Method Summary collapse
-
#resolve_with(dependency) ⇒ Dependency::Model
private
Resolve a dependency.
-
#substitutions ⇒ Hash{Symbol=>Symbol}
private
Map for substituting names on dependency.
Methods inherited from Base
#dependencies, #dependency_graph_mapper, #field, #new_dependency, #options, #resolve_dependency, #resolve_pair, #validator_class
Instance Method Details
#resolve_with(dependency) ⇒ Dependency::Model
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Resolve a dependency
30 31 32 33 34 35 36 |
# File 'lib/interdependence/dependency_resolver/model.rb', line 30 def resolve_with(dependency) validation_dependency( substitutions.fetch(dependency.field_name), dependency.validator_class, dependency. ) end |
#substitutions ⇒ Hash{Symbol=>Symbol}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Map for substituting names on dependency
20 |
# File 'lib/interdependence/dependency_resolver/model.rb', line 20 attribute :substitutions, Hash, strict: true |