Class: ActiveRecord::HierarchicalQuery::CTE::QueryBuilder
- Inherits:
-
Object
- Object
- ActiveRecord::HierarchicalQuery::CTE::QueryBuilder
- Defined in:
- lib/active_record/hierarchical_query/cte/query_builder.rb
Overview
CTE query builder
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#cycle_detector ⇒ Object
readonly
Returns the value of attribute cycle_detector.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #bind_values ⇒ Object
- #build_arel ⇒ Arel::SelectManager
-
#initialize(query, options: {}) ⇒ QueryBuilder
constructor
A new instance of QueryBuilder.
Constructor Details
#initialize(query, options: {}) ⇒ QueryBuilder
Returns a new instance of QueryBuilder.
20 21 22 23 24 25 |
# File 'lib/active_record/hierarchical_query/cte/query_builder.rb', line 20 def initialize(query, options: {}) @query = query @columns = Columns.new(@query) @cycle_detector = CycleDetector.new(@query) @options = end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
12 13 14 |
# File 'lib/active_record/hierarchical_query/cte/query_builder.rb', line 12 def columns @columns end |
#cycle_detector ⇒ Object (readonly)
Returns the value of attribute cycle_detector.
12 13 14 |
# File 'lib/active_record/hierarchical_query/cte/query_builder.rb', line 12 def cycle_detector @cycle_detector end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/active_record/hierarchical_query/cte/query_builder.rb', line 12 def @options end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
12 13 14 |
# File 'lib/active_record/hierarchical_query/cte/query_builder.rb', line 12 def query @query end |
Instance Method Details
#bind_values ⇒ Object
27 28 29 |
# File 'lib/active_record/hierarchical_query/cte/query_builder.rb', line 27 def bind_values union_term.bind_values end |
#build_arel ⇒ Arel::SelectManager
32 33 34 35 36 37 38 39 |
# File 'lib/active_record/hierarchical_query/cte/query_builder.rb', line 32 def build_arel build_manager build_select build_limits build_order @arel end |