Class: Interdependence::Dependency::Model
- Defined in:
- lib/interdependence/dependency/model.rb
Overview
Model dependency wrapper
Instance Method Summary collapse
-
#dependencies ⇒ ObservableDependencySetGraph
private
Dependencies clone with self replacing the unset equivalent dependency.
-
#proxy_field? ⇒ false
private
Is class a proxy field?.
-
#substitutions ⇒ Hash{Symbol => Symbol}
private
Map for substituting names on dependency.
-
#to_active_model ⇒ Array
private
Formats dependency as parameters for ActiveModel::Model#validates.
Methods inherited from Base
#==, #clone, #field, #field=, #field_name, #field_name=, #inspect, #options, #options=, #unset_equivalent_of?, #unspecified_field?, #unspecified_options?, #validator_class, #validator_class=
Instance Method Details
#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.
Dependencies clone with self replacing the unset equivalent dependency
30 31 32 33 34 |
# File 'lib/interdependence/dependency/model.rb', line 30 def dependencies super.change_owner(new_owner: self) do |current_owner| current_owner.unset_equivalent_of?(self) end end |
#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?
20 21 22 |
# File 'lib/interdependence/dependency/model.rb', line 20 def proxy_field? false 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
11 |
# File 'lib/interdependence/dependency/model.rb', line 11 attribute :substitutions, Hash |
#to_active_model ⇒ Array
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.
Formats dependency as parameters for ActiveModel::Model#validates
42 43 44 |
# File 'lib/interdependence/dependency/model.rb', line 42 def to_active_model [validator_class, .merge(attributes: [field_name])] end |