Class: Interdependence::Validator::Validator
- Inherits:
-
Object
- Object
- Interdependence::Validator::Validator
- Defined in:
- lib/interdependence/validator/validator.rb
Overview
Interdependence validator wrapper
Instance Method Summary collapse
-
#field ⇒ Symbol
private
Field that #validator_class will validate.
-
#new_dependency ⇒ Dependency::Validator
private
Delegated method to #resolver for creating new Dependency::Validator.
-
#resolver ⇒ DependencyResolver::Validator
private
Memoized resolver.
-
#save ⇒ ObservableDependencySetGraph
private
Observe new dependency and merge its dependencies into #validator‘s.
-
#validator ⇒ Class
private
Validator that owns #validator_class.
-
#validator_class ⇒ Class
private
ActiveModel::Validator class that is owned by #validator.
-
#validator_dependencies ⇒ ObservableDependencySetGraph
private
Delegated method to #validator for accessing dependency graph.
Instance Method Details
#field ⇒ 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.
Field that #validator_class will validate
22 |
# File 'lib/interdependence/validator/validator.rb', line 22 attribute :field, Symbol |
#new_dependency ⇒ Dependency::Validator
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.
Delegated method to #resolver for creating new Dependency::Validator
54 |
# File 'lib/interdependence/validator/validator.rb', line 54 delegate :dependencies, :new_dependency, to: :resolver |
#resolver ⇒ DependencyResolver::Validator
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.
Memoized resolver
83 84 85 |
# File 'lib/interdependence/validator/validator.rb', line 83 def resolver @resolver ||= DependencyResolver::Validator.new(self) end |
#save ⇒ ObservableDependencySetGraph
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.
Observe new dependency and merge its dependencies into #validator‘s
72 73 74 75 |
# File 'lib/interdependence/validator/validator.rb', line 72 def save validator_dependencies[validator.as_dependency] << new_observed_dependency validator_dependencies.merge!(dependencies) end |
#validator ⇒ Class
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.
Validator that owns #validator_class
14 |
# File 'lib/interdependence/validator/validator.rb', line 14 attribute :validator, Class |
#validator_class ⇒ Class
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.
ActiveModel::Validator class that is owned by #validator
30 |
# File 'lib/interdependence/validator/validator.rb', line 30 attribute :validator_class, Class, coercer: Types::ValidatorClassCoercer, strict: true |
#validator_dependencies ⇒ ObservableDependencySetGraph
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.
Delegated method to #validator for accessing dependency graph
64 |
# File 'lib/interdependence/validator/validator.rb', line 64 delegate :dependencies, to: :validator, prefix: true |