Class: Interdependence::DependencyResolver::Model

Inherits:
Base
  • Object
show all
Defined in:
lib/interdependence/dependency_resolver/model.rb

Overview

resolver for model dependencies

Constant Summary collapse

CACHE =
{}

Instance Method Summary collapse

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

Parameters:

Returns:



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.options
  )
end

#substitutionsHash{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

Returns:

  • (Hash{Symbol=>Symbol})
    substitution map


20
# File 'lib/interdependence/dependency_resolver/model.rb', line 20

attribute :substitutions, Hash, strict: true