Module: Dag::Polymorphic
- Defined in:
- lib/dag/polymorphic.rb
Defined Under Namespace
Modules: PolyEdgeInstanceMethods Classes: EndPoint, Sink, Source
Class Method Summary collapse
Instance Method Summary collapse
-
#conditions_for(source, sink) ⇒ Object
Contains class methods that extend the link model for polymorphic DAGs Builds a hash that describes a link from a source and a sink.
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/dag/polymorphic.rb', line 4 def self.included(base) base.send :include, PolyEdgeInstanceMethods end |
Instance Method Details
#conditions_for(source, sink) ⇒ Object
Contains class methods that extend the link model for polymorphic DAGs Builds a hash that describes a link from a source and a sink
55 56 57 58 59 60 61 62 |
# File 'lib/dag/polymorphic.rb', line 55 def conditions_for(source, sink) { ancestor_id_column_name => source.id, ancestor_type_column_name => source.type, descendant_id_column_name => sink.id, descendant_type_column_name => sink.type } end |