Class: ConceptQL::Nodes::TemporalNode
- Inherits:
-
BinaryOperatorNode
- Object
- Node
- BinaryOperatorNode
- ConceptQL::Nodes::TemporalNode
- Defined in:
- lib/conceptql/nodes/temporal_node.rb
Overview
Base class for all temporal nodes
Subclasses must implement the where_clause method which should probably return a proc that can be executed as a Sequel “virtual row” e.g. Proc.new { l.end_date < r.start_date }
Constant Summary
Constants inherited from Node
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
Methods inherited from BinaryOperatorNode
#children, #display_name, #graph_it
Methods inherited from Node
#arguments, #children, #columns, #date_columns, #evaluate, #initialize, #select_it, #stream, #types
Constructor Details
This class inherits a constructor from ConceptQL::Nodes::Node
Instance Method Details
#inclusive? ⇒ Boolean
18 19 20 |
# File 'lib/conceptql/nodes/temporal_node.rb', line 18 def inclusive? [:inclusive] end |
#query(db) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/conceptql/nodes/temporal_node.rb', line 11 def query(db) db.from(db.from(Sequel.expr(left.evaluate(db)).as(:l)) .join(Sequel.expr(right.evaluate(db)).as(:r), [:person_id]) .where(where_clause) .select_all(:l)) end |