Class: Interdependence::Dependency::Validator

Inherits:
Base
  • Object
show all
Defined in:
lib/interdependence/dependency/validator.rb

Overview

Validator dependency wrapper

Instance Method Summary collapse

Methods inherited from Base

#==, #clone, #dependencies, #field, #field=, #field_name, #field_name=, #inspect, #options, #unset_equivalent_of?, #unspecified_field?, #unspecified_options?, #validator_class, #validator_class=

Instance Method Details

#add_validator_observer(observer, method) ⇒ undefined

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.

add an observer to the validator's dependency graph

Parameters:

  • observer (Class)

    observer

  • method (Symbol)

    message to notify observer with

Returns:

  • (undefined)

28
29
30
# File 'lib/interdependence/dependency/validator.rb', line 28

def add_validator_observer(observer, method)
  validator_class.dependencies.add_observer(observer, method)
end

#options=(options) ⇒ undefined

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.

Set options

Parameters:

  • options (Hash, true, nil)

    set options. true becomes {}. nil becomes Types::UnsetOptions defaults to nil

Returns:

  • (undefined)

17
# File 'lib/interdependence/dependency/validator.rb', line 17

attribute :options, Hash, coercer: Types::OptionsCoercer, default: nil

#proxy_field?false

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.

Is class a proxy field?

Returns:

  • (false)

38
39
40
# File 'lib/interdependence/dependency/validator.rb', line 38

def proxy_field?
  true
end