Module: TypedDag::Node::InstanceMethods
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/typed_dag/node/instance_methods.rb
Instance Method Summary collapse
- #_dag_options ⇒ Object
- #from_edge(other_node) ⇒ Object
- #in_closure?(other_node) ⇒ Boolean
- #to_edge(other_node) ⇒ Object
Instance Method Details
#_dag_options ⇒ Object
21 22 23 |
# File 'lib/typed_dag/node/instance_methods.rb', line 21 def self.class. end |
#from_edge(other_node) ⇒ Object
11 12 13 14 |
# File 'lib/typed_dag/node/instance_methods.rb', line 11 def from_edge(other_node) ancestors_relations .where(.edge_table_name => { .from_column => other_node }) end |
#in_closure?(other_node) ⇒ Boolean
5 6 7 8 9 |
# File 'lib/typed_dag/node/instance_methods.rb', line 5 def in_closure?(other_node) from_edge(other_node) .or(to_edge(other_node)) .exists? end |
#to_edge(other_node) ⇒ Object
16 17 18 19 |
# File 'lib/typed_dag/node/instance_methods.rb', line 16 def to_edge(other_node) descendants_relations .where(.edge_table_name => { .to_column => other_node }) end |