Class: ConceptQL::Nodes::CastingNode
- Defined in:
- lib/conceptql/nodes/casting_node.rb
Overview
Parent class of all casting nodes
Subclasses must implement the following methods:
-
my_type
-
i_point_at
-
these_point_at_me
i_point_at returns a list of types for which the node’s table of origin has foreign_keys pointing to another table, e.g.: procedure_occurrence has an FK to visit_occurrence, so we’d put :visit_occurrence in the i_point_at array
these_point_at_me is a list of types for which that type’s table of origin has a FK pointing to the current node’s table of origin, e.g.: procedure_cost has an FK to procedure_occurrence so we’d put :procedure_cost in procedure_occurrence’s these_point_at_me array
Also, if a casting node is passed no streams, it will return all the rows in its table as results.
Direct Known Subclasses
Constant Summary
Constants inherited from Node
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
Methods inherited from Node
#arguments, #children, #columns, #date_columns, #evaluate, #initialize, #select_it, #stream
Constructor Details
This class inherits a constructor from ConceptQL::Nodes::Node
Instance Method Details
#castables ⇒ Object
30 31 32 |
# File 'lib/conceptql/nodes/casting_node.rb', line 30 def castables (i_point_at + these_point_at_me) end |
#query(db) ⇒ Object
34 35 36 37 |
# File 'lib/conceptql/nodes/casting_node.rb', line 34 def query(db) return db.from(make_table_name(my_type)) if stream.nil? base_query(db, stream.evaluate(db)) end |
#types ⇒ Object
26 27 28 |
# File 'lib/conceptql/nodes/casting_node.rb', line 26 def types [my_type] end |